Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.27.0
-
None
-
None
Description
I think the current (calcite-1.27.0 tag branch version) of the materialized view SQL rewrite has a big problem with SQL support that contains limit and order by. It does not contain limit and order by and is more flexible. After including limit and order by, the materialized view Only when SQL and query SQL are exactly the same can the hit be rewritten. Has this problem been resolved in the latest version?
for example:
Materialization view SQL:
SELECT t.a,t.b,t1.a,t1.b FROM jrc.test10 as t LEFT JOIN jrc.test16 as t1 on t.a=t1.a WHERE t.b > 10 ORDER BY t.a
The query SQL:
SELECT t.a,t.b,t1.a,t1.b FROM jrc.test10 as t LEFT JOIN jrc.test16 as t1 on t.a=t1.a WHERE t.b > 20 ORDER BY t.a
This query cannot be matched.
Attachments
Issue Links
- duplicates
-
CALCITE-771 Use materialization for scan-project-sort query
- Open
-
CALCITE-3626 Can't apply materialized view with a simple sort
- Closed