Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Why should we have multiple FileGroups instead of one? Expand / Collapse
Author
Message
Posted Monday, March 25, 2013 6:50 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, April 07, 2014 11:09 PM
Points: 220, Visits: 536
I just happen to visit a good forum site on SQL Server. Over there, there was one article which says that we should have more than one FileGroup because it is good pratice. But over there the author failed to mention why should we not have single FileGroup ? Could any body help me understand this?
Post #1434882
Posted Monday, March 25, 2013 7:03 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 9:59 AM
Points: 41,508, Visits: 34,425
Another article making blanket statements without explaination .... :-(

Multiple filegroups - maybe. Not always. Two reasons.
Split for performance - requires that the DB is IO bound to have any effect and that the filegroups are split onto multiple separate IO paths. Multiple files on the same drive will have no effect. Requires some careful analysis of which tables and indexes get the heaviest IO load.

Split for recoverability - for when the DB is large enough that it can't be restored in the time allowed by the RTO. Split the DB so that the critical part can be restored fast and the rest later. Requires Enterprise edition and careful analysis of what tables are needs by what parts of the app, what's critical and what's not.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1434887
Posted Monday, March 25, 2013 7:10 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: 2 days ago @ 9:15 AM
Points: 88, Visits: 357
Say you have a table of sales you could partition on sales date, so have one file per year.

Performance would be better for queries in that time period
Post #1434889
Posted Monday, March 25, 2013 7:23 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 9:59 AM
Points: 41,508, Visits: 34,425
terry999 (3/25/2013)
Say you have a table of sales you could partition on sales date, so have one file per year.

Performance would be better for queries in that time period


Partitioning is not about performance, it's about manageability, data loads, large deletes. It may help performance, but it's by no means guaranteed.
https://www.simple-talk.com/sql/database-administration/gail-shaws-sql-server-howlers/



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1434896
Posted Monday, March 25, 2013 7:27 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, April 11, 2014 1:53 AM
Points: 339, Visits: 211
Certainly, partitioning is one case for multiple file groups (although I have seen sliding windows partitions on the PRIMARY filegroup). If you partition-align your indexes as well, that's a win right there

I also like to split Sharepoint content databases into multiple file groups, one for all the internal Sharepoint stuff, and another for user-generated objects (AllDocs, AllLists, etc). This helps reduce resource contention at the page level in the data file. IO is still a bit of an issue, since all filegroups and files are on the same mountpoint, but our current setup is performant enough with the content databases split.





sqlmunkee
Bringing joy and happiness via SQL Server since 1998
Post #1434900
Posted Monday, March 25, 2013 7:48 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: 2 days ago @ 9:15 AM
Points: 88, Visits: 357
Thanks nice article

I cannot use it I have workgroup edition.

Post #1434920
Posted Monday, March 25, 2013 1:40 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, March 28, 2014 2:32 PM
Points: 503, Visits: 1,460
Interesting.. when reading that you can restore a single filegroup, I wondered about the wizdom of doing a filegroup restore rather than the entire database because of potential referencial issues. (This book was lacking because it often described what you can do with no examples of scenarios when or why you would want to do them).

But if the data is partitioned so that you don't have two-way dependency between tables in different filegroups, then this wouldn't be an issue. For example, if you had 2001-2005 sales data in one filegroup and 2006-2010 sales data on another, you could restore one without needing to restore the other. Or if you did need to restore both and they were on different I/O paths, you could restore them simultaniously in less time than it would take if they were in one larger filegroup. Am I understanding this right?
Post #1435124
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse