Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit336879f

Browse files
committed
Improve find_em_expr_usable_for_sorting_rel comment
Clarify the relationship between find_em_expr_usable_for_sorting_rel andprepare_sort_from_pathkeys, i.e. what restrictions need to be sharedbetween those two places.Author: James ColemanReviewed-by: Tomas VondraBackpatch-through: 13Discussion:https://postgr.es/m/CAAaqYe8cK3g5CfLC4w7bs%3DhC0mSksZC%3DH5M8LSchj5e5OxpTAg%40mail.gmail.com
1 parentaa97890 commit336879f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

‎src/backend/optimizer/path/equivclass.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,9 +795,11 @@ find_em_expr_for_rel(EquivalenceClass *ec, RelOptInfo *rel)
795795
}
796796

797797
/*
798-
* Find an equivalence class member expression that can be safely used by a
799-
* sort node on top of the provided relation. The rules here must match those
800-
* applied in prepare_sort_from_pathkeys.
798+
* Find an equivalence class member expression that can be safely used to build
799+
* a sort node using the provided relation. The rules are a subset of those
800+
* applied in prepare_sort_from_pathkeys since that function deals with sorts
801+
* that must be delayed until the last stages of query execution, while here
802+
* we only care about proactive sorts.
801803
*/
802804
Expr*
803805
find_em_expr_usable_for_sorting_rel(PlannerInfo*root,EquivalenceClass*ec,

‎src/backend/optimizer/plan/createplan.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5844,6 +5844,9 @@ make_incrementalsort(Plan *lefttree, int numCols, int nPresortedCols,
58445844
*
58455845
* Returns the node which is to be the input to the Sort (either lefttree,
58465846
* or a Result stacked atop lefttree).
5847+
*
5848+
* Note: Restrictions on what expressions are safely sortable may also need to
5849+
* be added to find_em_expr_usable_for_sorting_rel.
58475850
*/
58485851
staticPlan*
58495852
prepare_sort_from_pathkeys(Plan*lefttree,List*pathkeys,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp