关键字:DB2 数据库 最佳实践

图7:Querythatisnon-indexableandnon-sargable(stage2)
一个新场景被创建并且查询被重写在列值中使用"a>="和"a<="。注意,谓词现在是可索引的和sargable。记住以上的信息,谓词现在将由数据管理器(阶段1)处理,以减少这次查询的潜在响应时间。

图8:查询是indexable和sargable(阶段1)
随后可以使用比较工具来比较他们和"<>"之间的性能,会发现"<>"更有效的减少消耗的时间。

图9:耗时减半
解决的技巧3:选择唯一需要的列:
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/