November 13, 2014 at 9:25 am
Hi Team,
We have a 1.4 billion record table which will grow to about 4 billion in the next year or so.
It is a Fact table, mostly with Keys and metrics (both integer values)
We are planning to partition it on Date_Key.
The question is "How many rows should be in each partition"?
Some say that you should have ~ 30 million records in each partition, regardless of whether it is Fact table with all the integers or a Flat table with mostly strings (which would be much much larger).
My understanding of how partitioning is utilized is limited.
Could someone please shed some light on whether 30 million row (and not how much storage differently sized 30 million rows are taking) is the rule of thumb and why that is the case?
Or is there some other rule of thumb?
Thank you in advance!
November 13, 2014 at 12:24 pm
Why are you partitioning it? What is the goal?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 13, 2014 at 1:03 pm
Good question 🙂
We are going to generate reports on a monthly basis by joining this Fact table to Dim_Date on a key.
Each month of data has about 100 million records.
The initial plan was to partition by month (so that when we generate a report only the month's data we need will be scanned), but it will mean each partition will have ~ 100 million records, and we are told that we should not exceed 30 million records per partition.
November 14, 2014 at 3:57 am
Ok, so what's the goal of the partitioning? Fast load? Parallel load? Index rebuilds at the partition level? Partition switching for archive/delete of old data?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 14, 2014 at 7:29 am
The main goal at the moment is to ensure that when a monthly report goes out we can get the data out fast.
Instead of scanning 1.4 - 4 billion records, we'd like to be scanning only 100 million records and do so in parallel.
November 14, 2014 at 8:18 am
sql_er (11/14/2014)
The main goal at the moment is to ensure that when a monthly report goes out we can get the data out fast.
Then stop wasting your time looking at partitioning.
https://www.simple-talk.com/sql/database-administration/gail-shaws-sql-server-howlers
Instead of scanning 1.4 - 4 billion records, we'd like to be scanning only 100 million records and do so in parallel.
If you're scanning the entire table, then either your indexing is inadequate or your queries can't use indexes, and unless you've got maxdop set to 1, a query against that many rows is going to be running in parallel.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 14, 2014 at 9:00 am
GilaMonster (11/14/2014)
sql_er (11/14/2014)
The main goal at the moment is to ensure that when a monthly report goes out we can get the data out fast.Then stop wasting your time looking at partitioning.
https://www.simple-talk.com/sql/database-administration/gail-shaws-sql-server-howlers
Instead of scanning 1.4 - 4 billion records, we'd like to be scanning only 100 million records and do so in parallel.
If you're scanning the entire table, then either your indexing is inadequate or your queries can't use indexes, and unless you've got maxdop set to 1, a query against that many rows is going to be running in parallel.
+1000
--Jeff Moden
Change is inevitable... Change for the better is not.
November 14, 2014 at 2:24 pm
We don't have any indexes on this Fact table.
Sounds like we need to have a conversation with our DBA 🙂
November 14, 2014 at 4:14 pm
sql_er (11/14/2014)
We don't have any indexes on this Fact table.Sounds like we need to have a conversation with our DBA 🙂
Oh my, YES! That's absolutely incredible! I don't believe I've ever heard of a table with no indexes that large before!
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply