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

As evidenced by [forum:/forumpost/f3f546025a|forum post f3f546025a], the

new RIGHT JOIN related restriction on the push-down optimization implemented
by [da3fba18742b6e0b] also needs to apply to the automatic index
(a.k.a. hash-join) optimization and to the Bloom filter optimization.
Computation of the restriction is now
moved into the sqlite3ExprIsSingleTableConstraint() routine.

FossilOrigin-Name: 4902015dcf3869f08d9986e422faa231d9218a5e0fc59ba8df0f407e4eb3d605
This commit is contained in:
drh
2023-05-15 02:06:35 +00:00
parent fa746af4a3
commit eb4455e4e4
7 changed files with 84 additions and 26 deletions

View File

@ -207,4 +207,24 @@ do_execsql_test 4.3 {
SELECT * FROM t1 JOIN t2 ON false JOIN v6 ON true RIGHT JOIN t3 ON true;
} {- - - - 3}
# 2023-05-15 https://sqlite.org/forum/forumpost/f3f546025a
# This is restriction (6) on sqlite3ExprIsSingleTableConstraint().
# That restriction (now) used to implement restriction (9) on push-down.
# It is used for other things too, so it is not purely a push-down
# restriction. But it seems convenient to put it here.
#
reset_db
db null -
do_execsql_test 5.0 {
CREATE TABLE t1(a INT); INSERT INTO t1 VALUES(1);
CREATE TABLE t2(b INT); INSERT INTO t2 VALUES(2);
CREATE TABLE t3(c INT); INSERT INTO t3 VALUES(3);
CREATE TABLE t4(d INT); INSERT INTO t4 VALUES(4);
CREATE TABLE t5(e INT); INSERT INTO t5 VALUES(5);
SELECT *
FROM t1 JOIN t2 ON null RIGHT JOIN t3 ON true
LEFT JOIN (t4 JOIN t5 ON d+1=e) ON d=4
WHERE e>0;
} {- - 3 4 5}
finish_test