[MDEV-16502] Join pushdown to something like an IN filter for different storage engine Created: 2018-06-16 Updated: 2021-10-25 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Plugins |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Andrew Hutchings (Inactive) | Assignee: | Igor Babaev |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | smart_engine | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Extension of the join pushdown in MDEV-9062 we need a way to pushdown data from small tables in a join when pushdown join is used. Example: Customers often use InnoDB tables as pivot tables in AX which have very small number of rows so this is a common use case. There of course should be a threshold on this (a sysvar?), we don't know at what point this will become too expensive. I'm guessing an optimizer flag will be needed to separate to pushdown join but only allowed to be turned on when pushdown join is turned on. |
| Comments |
| Comment by Andrew Hutchings (Inactive) [ 2018-06-16 ] |
|
Additional clarification: this should only happen if the storage engine is not the one in the join push down. In my example it should not do this if the ColumnStore table only has say 100 rows. |
| Comment by Michael Widenius [ 2018-06-16 ] |
|
I think that converting things to an IN is the wrong approach and not something we should do (unless all other approaches fails). Problems:
A better, more general solution that would help both CS, Spider and KRAC would be to instead support |
| Comment by Andrew Hutchings (Inactive) [ 2018-06-16 ] |
|
I agree a more general solution should be created. I meant "something like IN". I don't know what the best implementation of this would be. |
| Comment by Gregory Dorman (Inactive) [ 2020-09-24 ] |
|
As written this is way too narrow (also appears to be applicable to ROW INTERFACE only, not when Select Handlers are involved). Presently, cross engine join in ColumnStore is a hack with endless problems in the field (security mainly, but not only). CS gets the entire query, connects back to server (using some ugly acrobatics with credentials), and runs select from InnoDB (applicable predicates applied). The result is fetched, hashed and processed, from here the same way as for any normal CS table (hash is the only join method in CS). Mathematically speaking, this is a poor man equivalent of Monty's thesis (just give the engine the small table as if it was his), except that the small table is being pulled by CS rather than pushed by server. Worthy of note is that CS sometimes does flip a small table part of join graph into IN clause (I am not sure if this ever happens in cross engine situations, though). The real and hugely valuable change would be to make server a true manager of federated queries when Smart Engines are in play. This would benefit XPAND equally (or more). This could be 100% covered by MDEV-22366.
My further theory is that if 22366 is done, with possible addon of temp table materializations in foreign engines in some cases, it will swallow 9062 also, leaving us with essentially one project covering main needs of both smart engines (XPAND and CS). Ralf is correct about both this and 9062 being a part of 22366. |