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

Condition pushdown from HAVING into WHERE

    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

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

                Dates

                • Created:
                  Updated: