views:

830

answers:

2

Hello everyone,

I can not think of any reasons why we need to have multiple files inside a file group. The reason why I think of this way is we can control from T-SQL (end user) level about file group, but can not control from T-SQL (end user) level about individual files of a file group. Any comments or ideas why files are still needed?

thanks in advance, George

+1  A: 

I could provide a long explanation but MSDN does a good job of it here. It may be that you specifically don't need to have more than one file in a file group, but that is not true of everybody.

colithium
Hi colithium, I read this document before and I also read the related SQL Server 2008 book online edition of this document. But it never mentions why we need more than one files in a filegroup. If I missed anything in the document which says specifically why more files are good, please let me know.
George2
"distribute I/O across multiple drives" and "Some systems can improve their performance by controlling the placement of data and indexes onto specific disk drives. Filegroups can aid this process."
colithium
Agree fliegroup could improve performance. But my question is not about filegroup, my question is why we need to create multiple files inside a filegroup? As we can not control from T-SQL which file inside filegroup to use, I can not think of advantage and scenario of using multiple files.
George2
+1  A: 

Having multiple files per file group is only useful for the following reasons:

  1. Distributing disk I/O load over multiple disks for performance reasons. i.e. in cases where re-configuring the RAID configuration with additional disks is not possible, or there is no RAID.
  2. In cases where you have a VLDB and do not wish to deal with very large single files for logistical reasons.

There is 'urban legend' that SQL Server uses only 1 thread per file, so that the number of files should match the number of CPU's. This is however false, as discussed by Microsoft here.

Nick Kavadias
1. "Distributing disk I/O load over multiple disks for performance reasons" -- I think you mean using multiple files is of better performance of using one file even if with the same number of disk in disk array, why?2. "logistical reasons" -- what means logistical? Say some other words?
George2
I read the document you recommended and like it very much! Cool! I want to know whether it is SQL Server product formal announcement or just some technical guy's peer thoughts? :-)
George2
it has nothing to do with performance, but for example if your doing things like copying mdb files around, then copying a large 2TB file is much more difficult then copying 4 500GB files
Nick Kavadias
it's the closest to a formal announcement you'll get. The blog is from the microsoft's customer support team. They'd have accurate sources inside the SQL dev team, so I'd say it a reliable source.
Nick Kavadias
Thanks Nick, from T-SQL developer perspective, could we control from file level? Currenly I only know how to control from filegroup level.
George2
Hi Nick Kavadias, I read the document you recommended, but it never mentions more files means better performance. From which statement do you think it claims multiple files inside a filegroup means better performance?
George2