Global nonclustered index on partitioned table

You can create nonclustered, unpartitioned global indexes for all partitioning table strategies.

The index and the data partitions can reside on the same or different segments. You can create the index on any indexable column in the table.

The example in Figure 10-4 is indexed on the pub_name column; the table is partitioned on the pub_id column.

For this example, we use alter table to repartition publishers with three range partitions on the pub_id column.

alter table publishers partition by range(pub_id)
(a values <= ("100"),
b values <= ("200"),
c values <= ("300"))

To create a global nonclustered index on the pub_name column, enter:

create nonclustered index publish2_idx
	on publishers(pub_name)

Figure 10-4: Global nonclustered index on a partitioned table

This figure shows a nonclustered index on the name column, with four index pages below it, and eight leaf pages below them, partitioned a (id 0 to 100), b (id 101 to 200) , or c (id 201 to 300. Arrows point from specific index pages to specific partition leaves.

In Figure 10-5, the example is indexed on the pub_id column; the table is also partitioned on the pub_id column.

To create a global nonclustered index on the pub_id column, enter:

create nonclustered index publish3_idx
	on publishers(pub_id)

Figure 10-5: Global nonclustered index on a partitioned table

This figure shows a nonclustered global index on the pub_id column, with four index pages below it, and eight leaf pages below them, partitioned a (pub_id 0 to 100), b (pub_id 101 to 200) , or c (pub_id 201 to 300. Arrows point from specific index pages to specific partition leaves.