model-writtenrun 9770 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane proposed representing an empty FROM clause with a dummy one-row, zero-column relation to simplify subquery flattening and relation identification in the planner #1; answering Ashutosh Bapat, he explained that set-returning functions would retain their existing executor behavior #3 #4.
- Seven months later, Tom posted an implementation introducing RTE_RESULT and GroupResultPath, removing useless dummy relations after expression preprocessing and outer-join reduction, and retaining a fast path because ordinary planning slowed trivial queries by roughly 10% #5.
- Tom then replaced the initial executor workaround for whole-row references with planner-side removal of RTE_RESULT rowmarks, keeping the executor unchanged #7.
- Mark Dilger's testing and documentation questions, together with Alexander Kuzmenkov's join tests, benchmarks, and naming suggestions, led to clearer planner-only RTE_RESULT documentation, clarified semijoin handling, and an EvalPlanQual isolation test #8 #10 #12.
- David Rowley's code review prompted more efficient bitmap iteration and comment improvements, while Alexander's assertion-disabled build warning was also fixed; Tom explained that improved PlaceHolderVar nullability analysis justified the changed outer-join plan #16 #11 #17.
- Tom noticed that the new optimization removed joins needed by an existing regression test, and David measured a slowdown for trivial SELECT queries; the final submission preserved the old test using real one-row tables, retained a separate optimization test, and reduced allocation overhead in build_simple_rel #18 #19 #20.
- David reviewed and benchmarked the final submission, confirmed reduced overhead, requested a clearer test-table name, and found INSERT performance differences within the noise level #21 #24.
- Mark questioned two switch statements and then confirmed the final patch passed all tests on macOS #27 #28; a naming discussion was resolved by clarifying that the dummy table existed only in regression tests #29 #30 #31 #32.
- Tom declined the extra switch cases because they were unreachable, renamed the test table to onerow, and committed #20 with only light naming and formatting changes as 4be058fe9e, closing the thread with the work landed #33.