Kristofferjoha commented on issue #28002: URL: https://github.com/apache/datafusion/issues/28002#issuecomment-7406419645
If we go with the StateId idea, it might be worth also thinking about how long state lives. DuckDB wrote about this for recursive CTEs in https://duckdb.org/2026/08/25/how-duckdb-runs-recursive-ctes-faster. They keep state that doesnt depend on the recursion across iterations instead of rebuilding it. I tested a reachability query over 1M edges. `RecursiveQueryExec` resets the whole recursive term each iteration, so the edges table gets scanned and probed every time. 500 iterations took 1.0s, 1000 took 2.0s. I changed it so edges is the build side, built once with PreparedHashJoinBuild. That was ~7x faster, and ~100x with a single-partition probe, though that one was slower on a random graph with big frontiers. #26270 gives each iteration a child RunState, so run-level and iteration-level state seems like a natural fit. Not sure if this is something to discuss now or more of a future improvement. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
