Details
-
New Feature
-
Status: In Testing (View Workflow)
-
Critical
-
Resolution: Unresolved
-
Q2/2025 Development, Q3/2025 Maintenance
Description
Add a new-style hint to control Split Materialized (aka "Lateral Derived") optimization.
The PR is here: https://github.com/MariaDB/server/pull/4019 .
Hint effect
- NO_SPLIT_MATERIALIZED(X) disables use of Split-Materialized optimization in the context of X (I will elaborate below on what is X).
- SPLIT_MATERIALIZED(X) forces use of Split-Materialized in the context of X unless it is otherwise impossible to do (e.g. because a table is not a materialized derived table, etc).
The hint should be attached to the derived table being split.
It seems a logical and natural location. Consider an example:
SELECT
|
/*+ SPLIT_MATERIALIZED(CUST_TOTALS) */ |
...
|
FROM
|
customer
|
(SELECT SUM(amount), o_custkey FROM orders GROUP BY o_custkey) as CUST_TOTALS |
WHERE
|
customer.c_custkey= o_custkey AND |
customer.country='FI'; |
CUST_TOTALS on its own "does not know" whether Split-materialized would be useful for it.
example: if you need totals for all customers, then probably it won't.
We learn that Split-Materialized is good to use for CUST_TOTALS when we look at the parent query. And realize that we will only require totals for customers from Finland.
SPLIT_MATERIALIZED should force use of splitting
Splitting should be used even when the optimizer would consider it to be not worth it.
Attachments
Issue Links
- causes
-
MDEV-37174 Hints SPLIT_MATERIALIZED JOIN_FIXED_ORDER and priority
-
- Closed
-
- split from
-
MDEV-33281 Implement optimizer hints like in MySQL 8
-
- Stalled
-