diff options
author | Tomas Vondra <tomas.vondra@postgresql.org> | 2020-12-22 02:00:39 +0100 |
---|---|---|
committer | Tomas Vondra <tomas.vondra@postgresql.org> | 2020-12-22 02:00:51 +0100 |
commit | 1ca2eb103113d64930cf1120ba2beaaebd1076f4 (patch) | |
tree | 509b74587f193d371b22e9422f161798f58f3401 /src/backend/optimizer/path/equivclass.c | |
parent | 9aff4dc01fbb9e126efafd839ae8541362328f1a (diff) | |
download | postgresql-1ca2eb103113d64930cf1120ba2beaaebd1076f4.tar.gz postgresql-1ca2eb103113d64930cf1120ba2beaaebd1076f4.zip |
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
Diffstat (limited to 'src/backend/optimizer/path/equivclass.c')
-rw-r--r-- | src/backend/optimizer/path/equivclass.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/optimizer/path/equivclass.c b/src/backend/optimizer/path/equivclass.c index 600fa1263a7..c33af06ec0e 100644 --- a/src/backend/optimizer/path/equivclass.c +++ b/src/backend/optimizer/path/equivclass.c @@ -798,9 +798,11 @@ find_em_expr_for_rel(EquivalenceClass *ec, RelOptInfo *rel) } /* - * Find an equivalence class member expression that can be safely used by a - * sort node on top of the provided relation. The rules here must match those - * applied in prepare_sort_from_pathkeys. + * Find an equivalence class member expression that can be safely used to build + * a sort node using the provided relation. The rules are a subset of those + * 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 * find_em_expr_usable_for_sorting_rel(PlannerInfo *root, EquivalenceClass *ec, |