Is there an advantage to not partition aligning an index?

The main advantage of not partitioning a (non-unique) index on a partitioned base object is that it works around a long-standing query optimizer limitation related to ordered data requests such as MIN, MAX, or TOP (n) queries.

On a partitioned index, the optimizer cannot generally translate MIN, MAX, or TOP (n) to the same operation per partition, followed by a final global aggregate over the per-partition partial aggregates. The optimizer instead chooses an execution plan that scans all partitions of the index. The exception to this is the single case where the aggregate or top operation is specified over the partitioning column.

I should mention that there are also very good reasons not to have any non-aligned indexes. Choosing to use a non-aligned index would have to be a very informed choice. I have done it myself (rarely) in the past, but in very specific circumstances where the benefits clearly outweighed the costs, or there was no other reasonable alternative.


Article by Itzik Ben-Gan explaining the issue.


There is the obvious issue around some constraints (eg. unique) requiring a non-aligned index.

Other than that the non-aligned indexes have a big cost (primarily they prevent many parallel operators from going thread-per-partition and the alternatives are memory expensive) and thus I would strongly advise against such indexes. Even with the cases listed by Paul, I would still advise against non-aligned indexes.


Non-aligned indexes negate the primary benefit of partitioning which is switching partitions. If you do not depend on that and are partitioning for other reasons (different storage, read-only partitions, incremental stats, ...) then go ahead and create non-aligned indexex.

Non-aligned indexes are useful because you can enforce unique constraints on the entire table with them. Also, non-aligned indexes do not require the partitioning key to be an implicit seek prefix. Imagine having 10000 partitions and querying not based on the partitioning key. The execution plan will then have to seek into 10000 partitions if the index was aligned. The other answers have further examples.