We will implement the following rule-based optimizations:
Filter pushdown
In particular pushing filters below joins. In the logical plan, WHERE conditions follow joins and will need to be pushed below the join in order to perform index selection.
Join selection
In the logical plan, joins are n-ary and are initially translated as cross joins. We need to optimize them as index joins if possible.
Table scan + filter -> index scan
After pushing down filters, we need to generate applicable index scans.
Project pull up
For both sql and subscriptions, the logical plan may have intermediate projections, but these can either be removed entirely, as is the case for subscriptions, or pulled up to the root of the query plan, as is the case for sql, to avoid materializing product values.
we think this is re-implementing optimizations we used to have in the old, less-modular query engine. Keeping as P1 since this is fixing a "regression".
We will implement the following rule-based optimizations:
Filter pushdown In particular pushing filters below joins. In the logical plan,
WHERE
conditions follow joins and will need to be pushed below the join in order to perform index selection.Join selection In the logical plan, joins are n-ary and are initially translated as cross joins. We need to optimize them as index joins if possible.
Table scan + filter -> index scan After pushing down filters, we need to generate applicable index scans.
Project pull up For both sql and subscriptions, the logical plan may have intermediate projections, but these can either be removed entirely, as is the case for subscriptions, or pulled up to the root of the query plan, as is the case for sql, to avoid materializing product values.