diff options
author | Tomas Vondra <tomas.vondra@postgresql.org> | 2020-04-07 16:43:18 +0200 |
---|---|---|
committer | Tomas Vondra <tomas.vondra@postgresql.org> | 2020-04-07 16:43:22 +0200 |
commit | ba3e76cc571eba3dea19c9465ff15ac3ac186576 (patch) | |
tree | 5f570294c455cec9fa956b99811453753bf872b1 /contrib/postgres_fdw/postgres_fdw.c | |
parent | c7654f6a37792ab9525ff98b710c23b27c7868a5 (diff) | |
download | postgresql-ba3e76cc571eba3dea19c9465ff15ac3ac186576.tar.gz postgresql-ba3e76cc571eba3dea19c9465ff15ac3ac186576.zip |
Consider Incremental Sort paths at additional places
Commit d2d8a229bc introduced Incremental Sort, but it was considered
only in create_ordered_paths() as an alternative to regular Sort. There
are many other places that require sorted input and might benefit from
considering Incremental Sort too.
This patch modifies a number of those places, but not all. The concern
is that just adding Incremental Sort to any place that already adds
Sort may increase the number of paths considered, negatively affecting
planning time, without any benefit. So we've taken a more conservative
approach, based on analysis of which places do affect a set of queries
that did seem practical. This means some less common queries may not
benefit from Incremental Sort yet.
Author: Tomas Vondra
Reviewed-by: James Coleman
Discussion: https://postgr.es/m/CAPpHfds1waRZ=NOmueYq0sx1ZSCnt+5QJvizT8ndT2=etZEeAQ@mail.gmail.com
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r-- | contrib/postgres_fdw/postgres_fdw.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 2175dff824d..9fc53cad680 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -6524,35 +6524,6 @@ conversion_error_callback(void *arg) } /* - * Find an equivalence class member expression, all of whose Vars, come from - * the indicated relation. - */ -Expr * -find_em_expr_for_rel(EquivalenceClass *ec, RelOptInfo *rel) -{ - ListCell *lc_em; - - foreach(lc_em, ec->ec_members) - { - EquivalenceMember *em = lfirst(lc_em); - - if (bms_is_subset(em->em_relids, rel->relids) && - !bms_is_empty(em->em_relids)) - { - /* - * If there is more than one equivalence member whose Vars are - * taken entirely from this relation, we'll be content to choose - * any one of those. - */ - return em->em_expr; - } - } - - /* We didn't find any suitable equivalence class expression */ - return NULL; -} - -/* * Find an equivalence class member expression to be computed as a sort column * in the given target. */ |