Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Partition-Aligned indexes in SQL Server 2008

Tags:

sql

indexing

How can I find if an index on a table in SQL 2008 is partition aligned or not?

like image 920
Narayana Avatar asked Dec 29 '10 07:12

Narayana


1 Answers

If is on the same partition scheme as the clustered index or as the base heap, then it is aligned. If it is on a different partition scheme but based on the same partition function, then it is aligned. If it is on a partition scheme based on a different partition function then you have to look at the properties of the two partition functions involved and compare them.

To see what partition scheme is an index created on, that depends on the tools you have. SSMS shows this in the table/index properties, SMO expose this programatically, and you can also query the catalog views in T-SQL (data_space_id in sys.indexes).

like image 142
Remus Rusanu Avatar answered Nov 15 '22 04:11

Remus Rusanu