Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1216

Add new rules for Materialised view optimisation of join queries

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: next
    • Fix Version/s: 1.8.0
    • Component/s: core
    • Labels:
      None

      Description

      This is to keep track of adding new rules that would enable optimisation using view of join queries. For instance, when we have materialised view of table 'X' named 'X_part' defined by query: " select * from X where X.a > '2016-01-01' " then we expect following query to be optimised by 'X_part':

      select * from X inner join Y on X.id = Y.xid inner join Z on Y.id=Z.yid where X.a > '2016-02-02' and Y.b = "Bangalore"

      Following are the changes done in Quark which we are planning to pull into Calcite:
      1. Add a new Rule for Filter on TableScan. Basically, after predicate has been pushed through join onto table scan, new rule checks if it can be optimised by Materialised View.
      https://github.com/qubole/quark/blob/master/optimizer/src/main/java/com/qubole/quark/planner/MaterializedViewFilterScanRule.java

      2. Add a new Unify rule to MaterialisedSubstitutionVisitor:
      https://github.com/qubole/incubator-calcite/commit/2d031d14d23810291377d92dc5ef2eaa515d35b7

        Activity

        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.8.0 (2016-06-13).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.8.0 (2016-06-13).
        Hide
        julianhyde Julian Hyde added a comment -
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/bf098dd6 ; thanks for the PR, Amogh Margoor !
        Hide
        amargoor Amogh Margoor added a comment -

        Thanks Julian Hyde . Fixup looks good.
        Thanks Michael Mior for the review.

        Show
        amargoor Amogh Margoor added a comment - Thanks Julian Hyde . Fixup looks good. Thanks Michael Mior for the review.
        Hide
        julianhyde Julian Hyde added a comment -

        PR looks good. I did some minor fix-ups in my branch https://github.com/julianhyde/calcite/commit/ba65724886d610732bd54c2ece4960021f72d499 including addressing the point that Michael Mior raised. Amogh Margoor, if my fix-ups look good I'll commit.

        Show
        julianhyde Julian Hyde added a comment - PR looks good. I did some minor fix-ups in my branch https://github.com/julianhyde/calcite/commit/ba65724886d610732bd54c2ece4960021f72d499 including addressing the point that Michael Mior raised. Amogh Margoor , if my fix-ups look good I'll commit.
        Hide
        amargoor Amogh Margoor added a comment -
        Show
        amargoor Amogh Margoor added a comment - Raising a PR: https://github.com/apache/calcite/pull/224

          People

          • Assignee:
            amargoor Amogh Margoor
            Reporter:
            amargoor Amogh Margoor
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development