Partitioning

Tag: partitioning

Partitioned Tables: Rolling/Rotating/Round-Robining Partitions

Partitioned Tables: Rolling/Rotating/Round-Robining Partitions

I recently received a terrific question about options for “rotating” table partitions.

Continue reading

Did that Query Eliminate Partitions? (videos)

Did that Query Eliminate Partitions? (videos)

Table partitioning makes execution plans a bit more confusing.

Free Course

I have a free online course which walks you through decoding execution plans, including whether or not partition elimination occurred.

Continue reading

How to Script Out Indexes from SQL Server

How to Script Out Indexes from SQL Server

Sometimes you need to script out all the indexes in a database. Maybe you’re concerned something has changed since they were last checked in. Or maybe the indexes aren’t checked into source control, and you’re working on fixing that. (Important!)

Either way, sometimes you need to do it, and it’s not fun through the GUI. I needed to write some fresh demo code for this recently, and I needed it to give the details for partitioned tables using data compression, and I thought I’d share.

Continue reading

Find the Partitioning Key on an Existing Table with Partition_Ordinal

Find the Partitioning Key on an Existing Table with Partition_Ordinal

By Kendra Little on March 15, 2016

Category: indexing

@SQLSista asked a fun question on Twitter recently about how to figure out the partitioning key on an existing table:

Bad Partitioned HEAP predates me. No clustered index, Primary Key on ID column and multiple datetime columns. How to find the partitioning key? #sqlhelp

Continue reading

How to Fix Lopsided Partitioned Tables

How to Fix Lopsided Partitioned Tables

Over the years I’ve gotten lots of emails and questions from students that start like this:

Help! My partitioned table has the wrong data in a partition! It’s lopsided. I started trying to fix it, but…

Continue reading

Did My Query Eliminate Table Partitions in SQL Server?

Did My Query Eliminate Table Partitions in SQL Server?

Working with table partitioning can be puzzling. Table partitioning isn’t always a slam dunk for performance: heavy testing is needed. But even getting started with the testing can be a bit tricky!

Here’s a (relatively) simple example that walks you through setting up a partitioned table, running a query, and checking if it was able to get partition elimination.

Continue reading