sql> create index dinya_idx_t on dinya_test(item_id) 2 global partition by range(item_id) 3 ( 4 partition idx_1 values less than (1000) tablespace dinya_space01, 5 partition idx_2 values less than (10000) tablespace dinya_space02, 6 partition idx_3 values less than (maxvalue) tablespace dinya_space03 7 );
index created.
sql>
本例中對表的item_id字段建立索引分區,當然也可以不指定索引分區名直接對整個表建立索引,如:
sql> create index dinya_idx_t on dinya_test(item_id);
index created.
sql>
同樣的,對全局索引根據執行計劃可以看出索引已經可以使用:
sql> select * from dinya_test t where t.item_id=12;