![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I already have a DB that uses partitions to divide data in US Counties, partitioned by state. Can I use TWO levels of partitioning? I mean... 3077 filegroups and 50 partition functions that address them, but can I use another function to group the 50 states? |
#3
| |||
| |||
|
|
Do I understand it correctly that you already have 50 partitions, and now you want even more? About what size do you expect per partition? I'm not sure that partitioning by state is the best strategy. The partition for California will be a lot bigger than the ones for Alaska and Rhode Island. |
#4
| |||
| |||
|
|
I know that, but partitioning by county makes the DB a lot easier to maintain. I have to work that way because I'm dealing with criminal records, and they are separated by county with a ton of different files, so for many of them I have to clear the table and reload the whole county every time I get an update. Easier on partitions... :-) Table size can be anywhere from 8000 to 3 million records, depending on the county. |
|
But, before trying, can I have 3077 files in ONE partition, and drop all the states stuff? |
#5
| |||
| |||
|
|
But, before trying, can I have 3077 files in ONE partition, and drop all the states stuff? No, in the topic for CREATE PARTITION FUNCTION, I found that you cannot have more than 999 boundary values. |
#6
| |||
| |||
|
|
Piero 'Giops' Giorgi (giorgi.piero (AT) gmail (DOT) com) writes: I know that, but partitioning by county makes the DB a lot easier to maintain. I have to work that way because I'm dealing with criminal records, and they are separated by county with a ton of different files, so for many of them I have to clear the table and reload the whole county every time I get an update. Easier on partitions... :-) Table size can be anywhere from 8000 to 3 million records, depending on the county. Deleting 8000 rows is a breeze, but deleting 3 million rows takes some resources, particularly if the rows are wide. But it still only a matter of minutes. |
#7
| |||
| |||
|
|
So, I'll be forced to have 3077 filegroups, grouped with 50 partitions. Is there a way to have a partition function/scheme that sees other schemes, instead of filegroups? |
|
On Jun 5, 3:24 pm, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote: But, before trying, can I have 3077 files in ONE partition, and drop all the states stuff? No, in the topic for CREATE PARTITION FUNCTION, I found that you cannot have more than 999 boundary values. Dang it... I kew there was a catch. So, I'll be forced to have 3077 filegroups, grouped with 50 partitions. Is there a way to have a partition function/scheme that sees other schemes, instead of filegroups? I mean Filegroups Counties (3077) - grouped by state (50) - all together in ONE partitioned table. Any Ideas? Thank you! Piero |
#8
| |||
| |||
|
|
You might consider a hybrid solution with 50 individual state tables included in a partitioned view, with each state table partitioned by county. This approach would leverage partitioning to quickly reload individual counties yet provide a seamless view of the entire country. |
#9
| |||
| |||
|
|
I do assume that (state, county) is an index. If not, then get that fixed yesterday. |
#10
| |||
| |||
|
|
You might consider a hybrid solution with 50 individual state tables included in a partitioned view, with each state table partitioned by county. This approach would leverage partitioning to quickly reload individual counties yet provide a seamless view of the entire country. That is exactly what I want to do, but unfortunately I'm not (YET) able to do it. How can I have a partitioned view of partitioned tables? I have the 50 state tables partitioned by county, but I can't get to the next step. Can someone post a small example of the thing? |
![]() |
| Thread Tools | |
| Display Modes | |
| |