db2单表优化的下令
db2单表优化的命令
reorg 和runstats 都是单个表优化
reorg table <tablename> 通过重构行来消除“碎片”数据并压缩信息,对表进行重组。
runstats on table <tbschema>.<tbname> 收集表 <tbname> 的统计信息。
reorgchk
reorgchk on table all 确定是否需要对表进行重组,对于对所有表自动执行 runstats 很有用。
举例:reorg 和runstats 单表优化,初始化的命令:
runstats on table tablename;
reorg table tablename;