mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Enhance the query planner so that it looks at multiple solutions to OR
expressions in the WHERE clause. FossilOrigin-Name: 5e19d054105fb16ff52d265d48cc87a418603f6f
This commit is contained in:
@ -699,5 +699,16 @@ do_test where2-11.4 {
|
||||
}
|
||||
} {4 8 10}
|
||||
|
||||
# Verify that the OR clause is used in an outer loop even when
|
||||
# the OR clause scores slightly better on an inner loop.
|
||||
do_execsql_test where2-12.1 {
|
||||
CREATE TABLE t12(x INTEGER PRIMARY KEY, y);
|
||||
CREATE INDEX t12y ON t12(y);
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT a.x, b.x
|
||||
FROM t12 AS a JOIN t12 AS b ON a.y=b.x
|
||||
WHERE (b.x=$abc OR b.y=$abc);
|
||||
} {/.*SEARCH TABLE t12 AS b .*SEARCH TABLE t12 AS b .*/}
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user