optimizePlan
Optimizes a plan: predicate pushdown, then the two proved-safe fusion rules, then projection pruning, and finally the shared-subplan prediction of the executor's per-collection memo. Every rule preserves the oracle contract; a plan nothing applies to returns unchanged.
Parameters
root | the plan root |
Returns
the optimized plan and its rule counters.