创建单个字段的全局索引
创建:
create index my_index on my_table (my column);
删除:
drop index my_index on my table;
包含索引(covered index)
创建携带其他字段的全局索引
create index my_index on my_table (column1) include (column2);
删除:
drop index my_index on my_table;
本地索引(local index)
local index适用于写操作频繁的场景。
索引数据和数据表的数据是存放在同一张表中(且是同一个Region),避免了在写操作的时候往不同的服务器的索引表中写索引带来的额外开销。
create local index my_index on my_table (column1,column2,column3...);