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.
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.
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