key_len还是8,不过变成了0.005s这是因为col1 BETWEEN 20 and 29是range scan(范围扫描),而col1 in(20,21,22,23,24,25,26,27,28,29)是多值相等,尽管结果一样,但是意义有着显著的不同.
基于76个网页-相关网页
index range scan 索引范围扫描 ; 查询 ; 扫描 ; 二.索引范围扫描
Partial range scan 局部范围扫描
Long Range Scan 远距离搜索 ; 远距离扫描
INDEX RANGE SCAN DESCENDING 索引范围降序扫描
large index range scan 扫描一个索引
BITMAP INDEX RANGE SCAN 位图索引范围扫描
Index x range scan 索引范围扫描 ; 按索引值范围扫描
l INDEX RANGE SCAN 按索引值范围扫描
Scan range 扫描范围 ; 扫描地址范围 ; 扫描电压范围
If DB2 used a single index range scan from 20 to 30, it would miss this document and return an incomplete query result.
如果DB 2在20到30之间使用单个索引范围扫描,则会错过该文档,并返回不完全的查询结果。
If your intention is a real "between" predicate, then the execution plan on the right is much better, because a single range scan with a start-top predicate delivers the matching row IDs only.
如果您的目的是要实现真正的“between”谓词,则右侧的执行计划会更好一些,因为带有启动谓词的单个范围扫描仅传递匹配的行id。
This scan USES only subsets of the full range of a composite index.
这种扫描只使用完整复合索引的子集。
应用推荐