Use ColumnarIndexScan for ORDER BY LIMIT 1 queries - #10476
Open
svenklemm wants to merge 1 commit into
Open
Conversation
|
@natalya-aksman, @dbeck: please review this pull request.
|
Create ColumnarIndexScan paths for eligible queries when all required columns can be reconstructed from segment-by columns and sparse order-by metadata. This allows boundary rows to be returned without decompressing batches. Extend the plan and executor output mapping to support projected scan paths as well as aggregate rewrites. Only select the optimization when all qualifications are pushed down and no decompression recheck is required.
svenklemm
force-pushed
the
sven/cis_orderby_limit
branch
from
August 30, 2026 09:23
67f4f7f to
5638367
Compare
akuzm
reviewed
Aug 31, 2026
| } | ||
|
|
||
| static bool | ||
| columnar_index_scan_query_supported(PlannerInfo *root) |
Member
There was a problem hiding this comment.
Why is columnar index scan planning is now in columnar scan planning? Shouldn't we keep them separate?
akuzm
reviewed
Aug 31, 2026
|
|
||
| static CustomPathMethods columnar_index_scan_path_methods = { | ||
| .CustomName = COLUMNAR_INDEX_SCAN_NAME, | ||
| .PlanCustomPath = columnar_index_scan_plan_path, |
Member
There was a problem hiding this comment.
Why did you decide to switch to cost-based planning for columnar index scan? Isn't it still absolutely better when applicable? I liked that we could skip the cost-based planning for it, because this requires less code and makes planning faster.
akuzm
reviewed
Aug 31, 2026
| List *targetlist, List *custom_scan_tlist, | ||
| List *exec_output_map, int flags); | ||
| extern Node *columnar_index_scan_state_create(CustomScan *cscan); | ||
| extern Plan *try_insert_columnar_index_scan_node(Plan *plan, List *rtable); |
Member
There was a problem hiding this comment.
Are you also keeping the old planning metod in addition to the new planning method?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create ColumnarIndexScan paths for eligible queries when all required
columns can be reconstructed from segment-by columns and sparse
order-by metadata. This allows boundary rows to be returned without
decompressing batches.
Extend the plan and executor output mapping to support projected scan
paths as well as aggregate rewrites. Only select the optimization when
all qualifications are pushed down and no decompression recheck is
required.