1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Allow an automatic index on a WHERE constraint where the RHS is does not

reference another table as long as the RHS is not a constant.

FossilOrigin-Name: 58acc2a8b38c5f13175c191697b4d2b663db1872
This commit is contained in:
drh
2014-06-17 09:00:54 +00:00
parent 9978e6a680
commit 6b7ff748a1
5 changed files with 27 additions and 16 deletions

View File

@ -92,12 +92,18 @@ do_eqp_test rtree6.2.3 {
0 1 1 {SEARCH TABLE t2 USING INTEGER PRIMARY KEY (rowid=?)}
}
do_eqp_test rtree6.2.4 {
SELECT * FROM t1,t2 WHERE v=10 and x1<10 and x2>10
do_eqp_test rtree6.2.4.1 {
SELECT * FROM t1,t2 WHERE v=+ii and x1<10 and x2>10
} {
0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0E1}
0 1 1 {SEARCH TABLE t2 USING AUTOMATIC COVERING INDEX (v=?)}
}
do_eqp_test rtree6.2.4.2 {
SELECT * FROM t1,t2 WHERE v=10 and x1<10 and x2>10
} {
0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0E1}
0 1 1 {SCAN TABLE t2}
}
do_eqp_test rtree6.2.5 {
SELECT * FROM t1,t2 WHERE k=ii AND x1<v