mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-23 20:27:19 +02:00
Improve find_em_expr_usable_for_sorting_rel comment
Clarify the relationship between find_em_expr_usable_for_sorting_rel and prepare_sort_from_pathkeys, i.e. what restrictions need to be shared between those two places. Author: James Coleman Reviewed-by: Tomas Vondra Backpatch-through: 13 Discussion: https://postgr.es/m/CAAaqYe8cK3g5CfLC4w7bs%3DhC0mSksZC%3DH5M8LSchj5e5OxpTAg%40mail.gmail.com
This commit is contained in:
parent
aa97890b6e
commit
336879f555
@ -795,9 +795,11 @@ find_em_expr_for_rel(EquivalenceClass *ec, RelOptInfo *rel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find an equivalence class member expression that can be safely used by a
|
* Find an equivalence class member expression that can be safely used to build
|
||||||
* sort node on top of the provided relation. The rules here must match those
|
* a sort node using the provided relation. The rules are a subset of those
|
||||||
* applied in prepare_sort_from_pathkeys.
|
* applied in prepare_sort_from_pathkeys since that function deals with sorts
|
||||||
|
* that must be delayed until the last stages of query execution, while here
|
||||||
|
* we only care about proactive sorts.
|
||||||
*/
|
*/
|
||||||
Expr *
|
Expr *
|
||||||
find_em_expr_usable_for_sorting_rel(PlannerInfo *root, EquivalenceClass *ec,
|
find_em_expr_usable_for_sorting_rel(PlannerInfo *root, EquivalenceClass *ec,
|
||||||
|
@ -5844,6 +5844,9 @@ make_incrementalsort(Plan *lefttree, int numCols, int nPresortedCols,
|
|||||||
*
|
*
|
||||||
* Returns the node which is to be the input to the Sort (either lefttree,
|
* Returns the node which is to be the input to the Sort (either lefttree,
|
||||||
* or a Result stacked atop lefttree).
|
* or a Result stacked atop lefttree).
|
||||||
|
*
|
||||||
|
* Note: Restrictions on what expressions are safely sortable may also need to
|
||||||
|
* be added to find_em_expr_usable_for_sorting_rel.
|
||||||
*/
|
*/
|
||||||
static Plan *
|
static Plan *
|
||||||
prepare_sort_from_pathkeys(Plan *lefttree, List *pathkeys,
|
prepare_sort_from_pathkeys(Plan *lefttree, List *pathkeys,
|
||||||
|
Loading…
Reference in New Issue
Block a user