Use OpenHash instead of OpenEphemeral for the RHS of IN operators if the

result is not needed for sorting.

FossilOrigin-Name: 715fac7749a6b1523fe9f7de8263f0c4d1571d07
This commit is contained in:
drh
2014-02-06 03:31:41 +00:00
parent 34c5ed29e8
commit 5eba9b73da
7 changed files with 38 additions and 31 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ ifcapable !subquery {
proc nEphemeral {sql} {
set nEph 0
foreach op [execsql "EXPLAIN $sql"] {
if {$op eq "OpenEphemeral"} {incr nEph}
if {$op eq "OpenEphemeral" || $op eq "OpenHash"} {incr nEph}
}
set nEph
}
+3 -3
View File
@@ -65,17 +65,17 @@ do_test in5-2.4 {
}
} {12a 56e}
do_test in5-2.5.1 {
regexp {OpenEphemeral} [db eval {
regexp {Open(Ephemeral|Hash)} [db eval {
EXPLAIN SELECT d FROM t2 WHERE a IN t3x AND b IN t1y AND c IN t1z
}]
} {1}
do_test in5-2.5.2 {
regexp {OpenEphemeral} [db eval {
regexp {Open(Ephemeral|Hash)} [db eval {
EXPLAIN SELECT d FROM t2 WHERE a IN t1x AND b IN t3y AND c IN t1z
}]
} {1}
do_test in5-2.5.3 {
regexp {OpenEphemeral} [db eval {
regexp {Open(Ephemeral|Hash)} [db eval {
EXPLAIN SELECT d FROM t2 WHERE a IN t1x AND b IN t1y AND c IN t3z
}]
} {1}