From 1fe16fa7464033b16064b87be067ed30ccd90d02 Mon Sep 17 00:00:00 2001 From: Naisila Puka <37271756+naisila@users.noreply.github.com> Date: Mon, 23 Oct 2023 13:01:48 +0300 Subject: [PATCH] Remove unnecessary pre-fastpath code (#7262) This code was here because we first implemented `fast path planner` via [#2606](https://github.com/citusdata/citus/pull/2606) and then later `deferred pruning` [#3369](https://github.com/citusdata/citus/pull/3369) So, for some years, this code was useful. --- .../planner/multi_router_planner.c | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/backend/distributed/planner/multi_router_planner.c b/src/backend/distributed/planner/multi_router_planner.c index 0d7a0de78..e70de5bbd 100644 --- a/src/backend/distributed/planner/multi_router_planner.c +++ b/src/backend/distributed/planner/multi_router_planner.c @@ -2324,27 +2324,11 @@ PlanRouterQuery(Query *originalQuery, TargetShardIntervalForFastPathQuery(originalQuery, &isMultiShardQuery, distributionKeyValue, partitionValueConst); - - /* - * This could only happen when there is a parameter on the distribution key. - * We defer error here, later the planner is forced to use a generic plan - * by assigning arbitrarily high cost to the plan. - */ - if (UpdateOrDeleteOrMergeQuery(originalQuery) && isMultiShardQuery) - { - planningError = DeferredError(ERRCODE_FEATURE_NOT_SUPPORTED, - "Router planner cannot handle multi-shard " - "modify queries", NULL, NULL); - return planningError; - } + Assert(!isMultiShardQuery); *prunedShardIntervalListList = shardIntervalList; - - if (!isMultiShardQuery) - { - ereport(DEBUG2, (errmsg("Distributed planning for a fast-path router " - "query"))); - } + ereport(DEBUG2, (errmsg("Distributed planning for a fast-path router " + "query"))); } else {