Advertisement
Intermediate SQL Server, Partitioning

How does partition elimination improve query performance for a partitioned table?

Short answer

Partition elimination allows SQL Server's query optimizer to skip scanning partitions that could not possibly contain data relevant to a query's filter condition, such as skipping every partition except the current year when a query filters for recent dates, dramatically…

Save SQL Server mock interview
Advertisement
AModel answer
Partition elimination allows SQL Server's query optimizer to skip scanning partitions that could not possibly contain data relevant to a query's filter condition, such as skipping every partition except the current year when a query filters for recent dates, dramatically reducing the amount of data that needs to be read.
-- Only the 2026 partition needs to be scanned
SELECT * FROM Sales
WHERE SaleDate >= '2026-01-01' AND SaleDate < '2027-01-01';
Real-world example
A reporting query filtering only for the current year's sales runs significantly faster on a properly partitioned table, since SQL Server automatically skips scanning several years of older, irrelevant partitions entirely.
Likely follow-ups
  • How do you verify that partition elimination is actually happening for a specific query?
  • What query patterns might accidentally prevent partition elimination from working?
Related topics