[MDEV-401] Better nested semi-join processing Created: 2012-07-18 Updated: 2015-11-17 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | optimizer | ||
| Issue Links: |
|
||||||||
| Description |
|
(this all started from https://bugs.launchpad.net/maria/+bug/929732) Currently, nested semi-joins are merged together into one semi-join. This makes semi-join optimization/execution simpler. This approach has downsides, though. If there is a semi-join subquery with multiple child semi-join subqueries, we will merge them all together into a semi-join that includes a cross-product join of the child subqueries. Running a cross-product join and then removing duplicates can be slow (see the launchpad bug for detailed description). Nested semi-join support The idea is to support nested semi-joins. It will be possible for one semi-join Semi-join nests will not be mixed with outer join nests. == Optimization === Table pullout
(TODO: what about PS and re-executions? we need to be able to keep the === SJ-Materialization optimize_semijoin_nests() performs pre-optimization of potential It is fairly trivial that we should run optimize_semijoin_nests() for It is not obvious what to do for a semi-join nest that is
== Semi-join optimization as part of join optimization Re-worked advance_sj_state() makes it not as hopeless as before. TODO: Can we just postpone semi-join flattening until table pullout is done? TODO: does current query plan representation allow for nesting? === FirstMatch == Execution
=== FirstMatch
=== SJ-Materialization
=== Loose Scan
|