Not adjust IndexPath cost if indexscan is off

pull/5140/head
Onur Tirtir 2021-07-26 17:16:54 +03:00
parent 51691a8994
commit a87405b6ba
1 changed files with 7 additions and 0 deletions

View File

@ -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,