1. 首页 > 知识 > 数据库

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

5、查看SQL语句索引优化建议

    db2advis -d 库名 -i test.sql


本文由傻鸟发布,不代表傻鸟立场,转载联系作者并注明出处:https://www.shaniao.net/database/135.html

加载中~

联系我们

在线咨询:点击这里给我发消息

微信号:

工作日:10:30-15:30,节假日休息