Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-19307

Use functional dependencies when searching for conditions that can be pushed into materialized derived tables

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • Optimizer
    • None

    Description

      Consider the following query that uses a materialized derived table

      select * from 
        (select c, count(d) from t1 where b=f(a) and c=g(b) group by a) as t
      where t.b < 2 and t.c > 3
      

      Currently neither b<2 nor c>3 can be pushed into the WHERE clause of derived table t as these conditions does not depend on grouping column a directly or indirectly through equalities.

      Using functional dependencies we could state that these conditions actually can be pushed into the WHERE clause of the derived table.

      Similarly functional dependencies could be used to push conditions into WHERE clauses of materialized subqueries as well as for pushing conditions from HAVING into WHERE.

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              igor Igor Babaev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.