LATERAL
set-returning function produces a suboptimal plan
#21779
Labels
A-optimizer
Area: SQL optimizer.
Milestone
Uh oh!
There was an error while loading. Please reload this page.
When creating a materialized view that uses a
CROSS JOIN LATERAL generate_series(1, v)
, RisingWave’s planner currently decomposes it into aHashAgg
+HashJoin
workflow, resulting in multiple exchanges, an aggregation, and a join:Produces:
However, the equivalent form:
Is planned as a single
StreamProjectSet
directly on the scan:We expect the planner to recognize
CROSS JOIN LATERAL generate_series(…)
as a row‐by‐row expansion (ProjectSet
), avoiding the extra deduplication and join.The text was updated successfully, but these errors were encountered: