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

Add rule to propagate constraints onto aliased columns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • 0.9.0-incubating
    • None

    Description

      Consider:

      SELECT *
      FROM emp JOIN dept ON emp.deptno = dept.deptno
      WHERE emp.deptno = 10

      Clearly we can push down "emp.deptno = 10" through the join. But we can also generate a constraint "dept.deptno = 10" on the other input to the join. This task is to add a rule to achieve that.

      The rule would propagate the constraints on column "a" onto column "b" when "a" and "b" are compared using "=" or other relational operator (e.g. ">") in a filter or join condition.

      The planner state should reflect the fact that such constraints are optional – i.e. the query produces the same result if the constraints are omitted – and therefore the constraints can be omitted if they turn out to be expensive to implement.

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/41
      Created by: julianhyde
      Labels:
      Created at: Fri May 17 01:13:26 CEST 2013
      State: open

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              github-import GitHub Import
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: