Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rule of thumb when to partition tables

I've seen many entries about partitioning tables, but there is not a lot of information on when you should make a partition.

Is there a rule of thumb when you should partition tables in SQL Server.

Thanks

like image 739
Node17 Avatar asked Oct 24 '22 19:10

Node17


1 Answers

My benchmarks indicate that it depends on the query load.

  • If the queries you perform ALWAYS contain a filter on the partition field the performance benefit is virtually instant (like 1000 records in the table is already beneficial)
  • If the queries do NOT always contain a filter on the partition field you really have to benchmark with a good sample of the query load before making the decision.

You also have to account for the partition system you use. if you use "static" partitions there is not much harm in creating them immediately. When you use a "sliding window" system you need to take into account the overhead of creating and merging partitions. (which can take a long time on big tables)

like image 113
Filip De Vos Avatar answered Oct 27 '22 11:10

Filip De Vos