Try a presorted outer path when referenced by an ORDER BY prefix

First seen: 2026-04-03 11:35:34+00:00 · Messages: 4 · Participants: 2

Latest Update

2026-05-25 · claude-opus-4-6

Lepikhov's Response to Parragi's Review

Lepikhov responds to the two issues raised by Zsolt Parragi, but does not provide a new patch version. The response is brief and primarily acknowledges/contextualizes rather than resolving:

On the JOIN_RIGHT dead code

Lepikhov confirms it is intentionally dead code — a placeholder/reminder for future work rather than a bug. He states it will be removed or properly addressed "in the next version, if the community is interested." This confirms the branch is unreachable as Parragi identified, and Lepikhov is aware.

On the pg_plan_advice breakage

Lepikhov pushes back on the framing. Rather than treating this as a problem with his patch, he characterizes it as a broader issue for extension developers: the patch expands the planner's search space in ways that are semantically correct but violate pg_plan_advice's internal assumptions about which plan shapes are possible. He argues that pg_plan_advice is overly restrictive compared to the core planner's actual API contract (using create_seqscan_path / add_path), and that extensions should not constrain core optimization progress.

He provides a pointer to an existing fix for the pg_plan_advice test failure, indicating the issue is already resolved on that extension's side.

Notable absence: No response on the correctness bug

Lepikhov does not address Parragi's most important finding — the missing qual == NULL guard in bound propagation that could produce wrong results when post-join filters are present. This is the most significant technical issue raised and remains unacknowledged in this message.