db2数据库创建索引,删除索引,查看表索引

1、建立表索引

    create index 索引名 on 表名(列名,列名);

2、删除表索引

    drop index 索引名 on 表名;

3、查看表索引

    select * from sysibm.sysindexes where tbname='表名';   ---表名区分大小写

    或者在后台可以用:

    describe indexes for table 表名;

4、查看SQL语句执行计划

    db2expln -d 库名 -f test.sql -t -g -z ";" > test.exp

猜你喜欢

转载自www.cnblogs.com/yinguojin/p/8985824.html