Skip to content

Let an ordering index scan hand its ORDER BY value to the target list [cf-7392] - #52

Draft
gburd wants to merge 12 commits into
masterfrom
ntsv
Draft

gburd wants to merge 12 commits into
masterfrom
ntsv

Conversation

@gburd

@gburd gburd commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Purpose (gburd fork): exercise CI + OCR AI review on the CF 7392 series before pgsql-hackers. Targets the fork's master; opened draft.
cf-7392: https://commitfest.postgresql.org/patch/7392/
Thread: https://postgr.es/m/8s5lT8erXzBMugXJQ6Wginbp_gc2B4hmCYhF0Q0GpnuK87eCAOcKs5K31AWCwraCNFIQt42wwkow_MPPubHg485MWv-zDBY4NL_JX9yJEEg=@burd.me


An ordering index scan (ORDER BY col <-> const) computes each row's ORDER BY value in the index AM. When the target list needs the same expression, the executor evaluates it again. This series lets the scan hand the value up instead, and teaches the planner to cost and choose plans accordingly.

  • 0001 Let an ordering index scan hand its ORDER BY values to the target list (new optional amcanreturnorderby(opfamily, opcintype, orderbyop); GiST point_ops, SP-GiST quad/kd point ops)
  • 0002 Don't charge an ordering index scan for ORDER BY values it returns
  • 0003 Let an ordering index scan below a join emit its ORDER BY values
  • 0004 Don't charge an index-only scan for index expressions it returns
  • 0005 Let an index-only scan win on the index expressions it returns
  • 0006 Carry index-computed values up through joins and Appends
  • 0007 Carry index-computed values through outer joins, Gather and ordered Appends

The two dev: commits under the series are local tooling and are not part of the patch set.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant