From a87405b6baf45c8097133c4bc880be43a3f1fa07 Mon Sep 17 00:00:00 2001 From: Onur Tirtir Date: Mon, 26 Jul 2021 17:16:54 +0300 Subject: [PATCH] Not adjust IndexPath cost if indexscan is off --- src/backend/columnar/columnar_customscan.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/columnar/columnar_customscan.c b/src/backend/columnar/columnar_customscan.c index 47cda8e63..a1c91fedc 100644 --- a/src/backend/columnar/columnar_customscan.c +++ b/src/backend/columnar/columnar_customscan.c @@ -19,6 +19,7 @@ #include "nodes/extensible.h" #include "nodes/pg_list.h" #include "nodes/plannodes.h" +#include "optimizer/cost.h" #include "optimizer/optimizer.h" #include "optimizer/pathnode.h" #include "optimizer/paths.h" @@ -276,6 +277,12 @@ static void RecostColumnarIndexPath(PlannerInfo *root, RelOptInfo *rel, Oid relationId, IndexPath *indexPath) { + if (!enable_indexscan) + { + /* costs are already set to disable_cost, don't adjust them */ + return; + } + ereport(DEBUG4, (errmsg("columnar table index scan costs estimated by " "indexAM: startup cost = %.10f, total cost = " "%.10f", indexPath->path.startup_cost,