join pushdown to storage engines

Description

Make it possible for a storage engine to take any query fragment to be executed internally in the engine. In particular, it should be possible to push joins, GROUP BY, ORDER BY, WHERE, HAVING.

Assorted thoughts:

  • this is step 1, only do simple cases, see below.

  • only push down joins when all tables in a query are in the same storage engine

  • interface to the server: replace all that with a pseudo-table? with a handler?

  • PS/SP reexecution — restore or keep? probably, restore. easier for the engine. and we rerun optimizer anyway

  • optimizer: no changes, in step 1 there is no cost estimation for pushed down joins.

  • EXPLAIN:

1

t1

...

pushed down

2

t2

...

pushed down

3

<PUSHDOWN RESULT>

...

for 1 and 2

  • UNION — don't, every UNION part is handled separately

  • derived tables, views: decide to materialize or merge, as usual. if merged — push together with the upper join, if materialized — push separately

  • subqueries: if materialized — push separately, if semijoin — push with the upper join, otherwise — don't.

  • partitioning: not affected

  • use FederatedX as a PoC

Environment

None

Status

Assignee

Unassigned

Reporter

Sergei Golubchik

Labels

None

External issue ID

None

External issue ID

None

Time tracking

160h

Components

Fix versions

Priority

Major