From ba3e76cc571eba3dea19c9465ff15ac3ac186576 Mon Sep 17 00:00:00 2001 From: Tomas Vondra Date: Tue, 7 Apr 2020 16:43:18 +0200 Subject: 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 --- contrib/postgres_fdw/postgres_fdw.c | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'contrib/postgres_fdw/postgres_fdw.c') 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 @@ -6523,35 +6523,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. -- cgit v1.2.3