1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +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

@ -168,7 +168,10 @@ do_test tpch01-1.1 {
} {/0 0 0 {SEARCH TABLE part USING INDEX bootleg_pti .P_TYPE=..} 0 1 2 {SEARCH TABLE lineitem USING INDEX lpki2 .L_PARTKEY=..}.*/}
do_test tpch01-1.1b {
set ::eqpres
} {/.* customer .* nation AS n1 .* nation AS n2 .*/}
} {/.* customer .* nation AS n1 .*/}
do_test tpch01-1.1c {
set ::eqpres
} {/.* supplier .* nation AS n2 .*/}
do_eqp_test tpch01-1.2 {
select
@ -185,3 +188,5 @@ group by
order by
revenue desc;
} {0 0 1 {SEARCH TABLE orders USING INDEX odi (O_ORDERDATE>? AND O_ORDERDATE<?)} 0 1 0 {SEARCH TABLE customer USING INDEX cpki (C_CUSTKEY=?)} 0 2 3 {SEARCH TABLE nation USING INDEX npki (N_NATIONKEY=?)} 0 3 2 {SEARCH TABLE lineitem USING INDEX lpki (L_ORDERKEY=?)} 0 0 0 {USE TEMP B-TREE FOR GROUP BY} 0 0 0 {USE TEMP B-TREE FOR ORDER BY}}
finish_test