[Possible Bug] Materialized view rewriting may cause circular dependency because of union rewriting

2022-12-30 Thread Mou Wu
(condition=[AND(OR(ISNULL($0), ISNULL($1)), EQ($0, ‘o'))]) TableScan(table=[p.src]) We call the union is union#1. And when we optimize filter#1, materialized view rewriting will get the result: TableScan(table=[mv#1]) So the filter#1 and the mv#1 will be in a same RelSet, we call

[jira] [Created] (CALCITE-5211) Stack overflow when using HBO for materialized view rewriting

2022-07-13 Thread wangrenjie (Jira)
wangrenjie created CALCITE-5211: --- Summary: Stack overflow when using HBO for materialized view rewriting Key: CALCITE-5211 URL: https://issues.apache.org/jira/browse/CALCITE-5211 Project: Calcite

[jira] [Created] (CALCITE-3848) Materialized view rewriting fails for mv consisting of group by on join keys

2020-03-09 Thread Vineet Garg (Jira)
Vineet Garg created CALCITE-3848: Summary: Materialized view rewriting fails for mv consisting of group by on join keys Key: CALCITE-3848 URL: https://issues.apache.org/jira/browse/CALCITE-3848

[jira] [Created] (CALCITE-2976) Improve materialized view rewriting coverage with disjunctive predicates

2019-04-02 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-2976: Summary: Improve materialized view rewriting coverage with disjunctive predicates Key: CALCITE-2976 URL: https://issues.apache.org/jira/browse/CALCITE

[jira] [Created] (CALCITE-2943) Materialized view rewriting logic calls getApplicableMaterializations each time the rule is triggered

2019-03-21 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-2943: Summary: Materialized view rewriting logic calls getApplicableMaterializations each time the rule is triggered Key: CALCITE-2943 URL: https

[jira] [Created] (CALCITE-2942) Materialized view rewriting logic instantiates RelMetadataQuery each time the rule is triggered

2019-03-21 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-2942: Summary: Materialized view rewriting logic instantiates RelMetadataQuery each time the rule is triggered Key: CALCITE-2942 URL: https://issues.apache.org

[jira] [Created] (CALCITE-2179) General improvements for materialized view rewriting rule

2018-02-14 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-2179: Summary: General improvements for materialized view rewriting rule Key: CALCITE-2179 URL: https://issues.apache.org/jira/browse/CALCITE-2179

[jira] [Created] (CALCITE-2137) Materialized view rewriting not being triggered for some join queries

2018-01-16 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-2137: Summary: Materialized view rewriting not being triggered for some join queries Key: CALCITE-2137 URL: https://issues.apache.org/jira/browse/CALCITE-2137

[jira] [Created] (CALCITE-1802) Add post-aggregation step for Union in materialized view rewriting

2017-05-22 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-1802: Summary: Add post-aggregation step for Union in materialized view rewriting Key: CALCITE-1802 URL: https://issues.apache.org/jira/browse/CALCITE-1802

[jira] [Created] (CALCITE-1797) Support view partial rewriting in aggregate materialized view rewriting

2017-05-19 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-1797: Summary: Support view partial rewriting in aggregate materialized view rewriting Key: CALCITE-1797 URL: https://issues.apache.org/jira/browse/CALCITE-1797

[jira] [Created] (CALCITE-1795) Extend materialized view rewriting to produce rewritings using Union operators

2017-05-18 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-1795: Summary: Extend materialized view rewriting to produce rewritings using Union operators Key: CALCITE-1795 URL: https://issues.apache.org/jira/browse

[jira] [Created] (CALCITE-1791) Support view partial rewriting in join materialized view rewriting

2017-05-16 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-1791: Summary: Support view partial rewriting in join materialized view rewriting Key: CALCITE-1791 URL: https://issues.apache.org/jira/browse/CALCITE-1791

[jira] [Created] (CALCITE-1763) Recognize lossless casts in join/aggregate materialized view rewriting rule

2017-04-26 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-1763: Summary: Recognize lossless casts in join/aggregate materialized view rewriting rule Key: CALCITE-1763 URL: https://issues.apache.org/jira/browse/CALCITE

Re: Materialized view rewriting with joins

2016-09-27 Thread Michael Mior
I've considered using lattices, although I haven't done so at this point. I will note that I also haven't built the filter tree structure mentioned in the paper so there's still potential to fit in lattices for optimization. Right now the algorithm just examines all possible views for each query.

Re: Materialized view rewriting with joins

2016-09-27 Thread Julian Hyde
I haven't looked at your code yet but I am familiar with the paper. Did you consider implementing that paper by building on top of Calcite's lattice construct? The problem with "free form" materialized views is that there tend to be a lot of them. The paper aims to solve that problem, and so

Materialized view rewriting with joins

2016-09-27 Thread Michael Mior
Hi all, In a thread a while back I mentioned an interest in implementing view-based query rewriting rules for materialized views which include joins. Thanks to some help from Jesús, I have an initial implementation ready for discussion. It's very limited at this point, but does still handle some

Re: Materialized view rewriting

2016-02-25 Thread Michael Mior
Any suggestions on the best place to hook in and add the materialized views? It seems like doing so requires the SchemaPlus object corresponding to the current schema. The current best approach I see is to save a reference to the parent schema and then pull out the appropriate SchemaPlus object in

Re: Materialized view rewriting

2016-02-24 Thread Michael Mior
I expected as much re: code documentation. Totally understandable, but I figured it couldn't hurt to check. As for Cassandra and materialized views, that's exactly what I was thinking and the reason I opened the issue about updates to support Cassandra 3.x :) Calcite's automatic rewriting seems

Re: Materialized view rewriting

2016-02-24 Thread Julian Hyde
By the way, interesting that you are interested in Cassandra and materialized views. Cassandra announced materialized view support recently[1] but they solved only half of a problem (not an insignificant half, I hasten to add), namely materialized view maintenance. They don't transparently

Re: Materialized view rewriting

2016-02-24 Thread Julian Hyde
As is typical for complex pieces of code like this, the documentation is in the code (and the unit test). It's probably not what you wanted to hear, but the code mutates quite fast and so if we'd written a design doc a few months ago it would be partially inaccurate. I, Maryann Xue and Amogh

Materialized view rewriting

2016-02-24 Thread Michael Mior
Is there any documentation anywhere on how the current implementation of query rewriting for materialized views work? Mostly I'm referring to MaterializedViewSubstitutionVisitor. There's a lot of code to digest with not a lot of documentation and it would be helpful to have a reference to refer.