Blog Post

My Partitioning And Compression Quest!

,

So I have a pretty big database (around 1 TB) that’s getting a bit out of

hand.  I inherited it and have been doing things to improve it ever since I

started this new job.  And boy, there’s been some changes since I first

started.  Let’s just say that this database didn’t follow the common best

practices. 

So now, I’m to the point of considering partitioning and compression for the

really large tables for the following reasons:

  1. Utilizing different SAN arrays (RAID 10 and RAID 50)
  2. Index Maintenance
  3. Decreasing used disk space
  4. Lower logical/physical reads
  5. Faster query execution
  6. Archiving older, less used data

These are my results:

QueryDescriptionCPUElapsedScanLogicalPhysicalRead-AheadQuery CostExecution Count
Query1No Change02515329%
Query1Partitioned By Year (Page) and Month (Row)01571526152477%
Query1Page02414386%
Query1Row01815328%
Query2No Change02116339%11,077
Query2Partitioned By Year (Page) and Month (Row)0701527152477%11,077
Query2Page02315326%11,077
Query2Row02515328%11,077
Query3No Change9534624101892617242824%2
Query3Partitioned By Year (Page) and Month (Row)38940676150107701324891527%2
Query3Page51228254101739493251924%2
Query3Row6231714101826588245524%2
Query4No Change5891182225793056447830836%20
Query4Partitioned By Year (Page) and Month (Row)8533173037328952603226219%20
Query4Page13401104525315332843092615%20
Query4Row8069150725622155736121828%20
Query5No Change4086188125806337027830835%4,053
Query5Partitioned By Year (Page) and Month (Row)6147139831343103093227022%4,053
Query5Page845585125329053003092615%4,053
Query5Row5224157125635355746121828%4,053
Query6No Change03303306%1,594,377
Query6Partitioned By Year (Page) and Month (Row)0183151915083%1,594,377
Query6Page02003306%1,594,377
Query6Row01703306%1,594,377

 

What puzzles me is that the partitioned results are MUCH higher than if it

wasn’t partitioned at all.  I thought that since the queries were using the

partitioning column used in the partition function, that SQL Server would “know”

which partition the data resides on and seek only that partition thus seeking a

smaller data set.  Does anyone know why this isn’t the case in my testing?

I’m leaning on row compression for this table.  What do you guys think?

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating