Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
If there is a condition that depends only on the second table in a blocked join,
the following blocked join algorithms (BNL, BNLH) use this condition to pre-filter records from this table prior to joining the records.
Currently the optimizer extracts such a single table condition independently from the generic condition pushdown. As a result the same condition may be evaluated up to two times more. This is a problem if the condition is expensive. It also makes it problematic to move the condition to an optimal partial join (see MDEV-83).
Attachments
Issue Links
- blocks
-
MDEV-83 Cost-based choice for the pushdown of subqueries to joined tables
-
- Stalled
-
Activity
Status | Open [ 1 ] | In Progress [ 3 ] |
Description |
If there is a condition that depends only on the second table in a blocked join, the following blocked join algorithms (BNL, BNLH, BKAH) use this condition to pre-filter records from this table prior to joining the records. Currently the optimizer extracts such a single table condition independently from the generic condition pushdown. As a result the same condition may be evaluated up to two times more. This is a problem if the condition is expensive. It also makes it problematic to move the condition to an optimal partial join (see MDEV-83). |
If there is a condition that depends only on the second table in a blocked join, the following blocked join algorithms (BNL, BNLH) use this condition to pre-filter records from this table prior to joining the records. Currently the optimizer extracts such a single table condition independently from the generic condition pushdown. As a result the same condition may be evaluated up to two times more. This is a problem if the condition is expensive. It also makes it problematic to move the condition to an optimal partial join (see MDEV-83). |
Attachment | md5123.1.diff [ 23902 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Fix Version/s | 10.0.5 [ 13201 ] | |
Fix Version/s | 10.0.6 [ 13202 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | defaullt [ 29249 ] | MariaDB v2 [ 43423 ] |
Workflow | MariaDB v2 [ 43423 ] | MariaDB v3 [ 62518 ] |
Workflow | MariaDB v3 [ 62518 ] | MariaDB v4 [ 132204 ] |
"Generic" pushdown conditions are attached to specific joins via the member: JOIN_TAB::select_cond.
The filter conditions used by blocked join algorithms are attached to JOIN_TAB::cache_select::cond.
Currently the extraction of these conditions happens in the following places in the optimizer:
JOIN::optimize_inner calls:
Step #2: Extract WHERE/ON parts
...
tmp= make_cond_for_table(thd, cond, used_tables, current_map,
FALSE, FALSE);
...
if (tmp || !cond || tab->type == JT_REF || tab->type == JT_REF_OR_NULL ||
tab->type == JT_EQ_REF || first_inner_tab)
{
...
else if (tab->type == JT_ALL && ! use_quick_range)
}
if (!tab->hash_join_is_possible() ||
tab->make_scan_filter())
goto no_join_cache;
...
tab->cache= new JOIN_CACHE_BNLH(...)