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

Condition pushdown from HAVING into WHERE

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: 10.2
    • Component/s: Optimizer
    • Labels:
      None

      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              There are no comments yet on this issue.

                People

                • Assignee:
                  sanja Oleksandr Byelkin
                  Reporter:
                  psergey Sergei Petrunia
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated: