Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
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
- causes
-
MDEV-18668 Server crash or ASAN use-after-poison in Item_equal_iterator / st_select_lex::pushdown_from_having_into_where upon query with impossible WHERE condition
- Closed
-
MDEV-18675 Server crashes in COND_EQUAL::copy
- Closed
-
MDEV-18937 Wrong result caused by equality pushdown from HAVING
- Closed
-
MDEV-19025 No 'Impossible WHERE' message after pushdown when OR cond is used
- Closed
- is part of
-
MDEV-10137 Providing compatibility to other databases
- Open
- relates to
-
MDEV-4517 Upper query conditions push down to (aggregated) VIEWs
- Closed
-
MDEV-12387 Push conditions into materialized IN subqueries
- Closed
-
MDEV-4571 CLOSE - Query cache like features
- Closed
-
MDEV-9197 Pushdown conditions into non-mergeable views/derived tables
- Closed