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

Condition pushdown from HAVING into WHERE

    XMLWordPrintable

Details

    Description

      Consider a query

      SELECT agg_func(...), ... 
      FROM table ... WHERE ... 
      GROUP BY col 
      HAVING cond1(col) AND cond2(agg_func(...))

      Here, cond1(col) can be pushed down from HAVING into WHERE clause. cond2(agg_func(..)) cannot be pushed down.

      Basically, we can push down conditions that remain constant across the GROUP BY groups. Pushdown allows to filter out the whole groups.

      This task is about

      • splitting the condition that can be pushed down
      • moving from HAVING into WHERE, adjusting it appropriately

      Attachments

        Issue Links

          Activity

            People

              shagalla Galina Shalygina (Inactive)
              psergei Sergei Petrunia
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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