- 论坛徽章:
- 0
|
在db2的红皮书上看到一段话,不太理解,
assume that there is an index on columns (C1,C2,C3,C4) of the table and that 0 is the lowest value in each column.
1. WHERE C1=5 AND C2=7
Both predicates are stage 1 and the compound predicate is indexable. A matching index scan could be used with C1 and C2 as matching columns.
2. WHERE C1=5 AND C2>7
Both predicates are stage 1 and the compound predicate is indexable. A matching index scan could be used with C1 and C2 as matching columns.
3. WHERE C1>5 AND C2=7
Both predicates are stage 1, but only the first matches the index. A matching index scan could be used with C1 as a matching column.
为啥第3个里面C2不能index呢? |
|