Changeset: a8a1d4baf8bc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a8a1d4baf8bc
Modified Files:
sql/test/BugTracker-2026/Tests/7970-optimize-where-predicate.test
Branch: Dec2025
Log Message:
Extend test #7970 with WHERE clause using date literals instead of timestamp
literals.
It makes a difference in the generation of the logical execution plan.
diffs (39 lines):
diff --git a/sql/test/BugTracker-2026/Tests/7970-optimize-where-predicate.test
b/sql/test/BugTracker-2026/Tests/7970-optimize-where-predicate.test
--- a/sql/test/BugTracker-2026/Tests/7970-optimize-where-predicate.test
+++ b/sql/test/BugTracker-2026/Tests/7970-optimize-where-predicate.test
@@ -130,6 +130,35 @@ JOIN mre_b AS b
LEFT JOIN mre_c AS c ON TRUE
----
+-- check plan when using correct date literals, so use WHERE b.d BETWEEN date
'2023-01-01' and date '2023-12-31'
+query T nosort
+EXPLAIN
+SELECT c.x
+FROM mre_a AS a
+JOIN mre_b AS b ON TRUE
+LEFT JOIN mre_c AS c ON TRUE
+WHERE b.d BETWEEN date '2023-01-01' and date '2023-12-31';
+----
+project (
+| left outer join (
+| | crossproduct (
+| | | table("sys"."mre_a") [ "mre_a"."%TID%" as "a"."%TID%" ],
+| | | select (
+| | | | table("sys"."mre_b") [ "mre_b"."d" as "b"."d" ]
+| | | ) [ (date "2023-01-01") <= ("b"."d") <= (date "2023-12-31") ]
+| | ) [ ],
+| | table("sys"."mre_c") [ "mre_c"."x" as "c"."x" ]
+| ) [ ]
+) [ "c"."x" ]
+
+query I nosort
+SELECT c.x
+FROM mre_a AS a
+JOIN mre_b AS b ON TRUE
+LEFT JOIN mre_c AS c ON TRUE
+WHERE b.d BETWEEN date '2023-01-01' and date '2023-12-31';
+----
+
statement ok
DROP TABLE IF EXISTS mre_c
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]