|
140 | 140 | #include "utils/timestamp.h"
|
141 | 141 | #include "utils/typcache.h"
|
142 | 142 |
|
| 143 | +#define DEFAULT_PAGE_CPU_MULTIPLIER 50.0 |
143 | 144 |
|
144 | 145 | /* Hooks for plugins to get control when we ask for stats */
|
145 | 146 | get_relation_stats_hook_type get_relation_stats_hook = NULL;
|
@@ -6865,7 +6866,7 @@ btcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
|
6865 | 6866 | * touched. The number of such pages is btree tree height plus one (ie,
|
6866 | 6867 | * we charge for the leaf page too). As above, charge once per SA scan.
|
6867 | 6868 | */
|
6868 |
| - descentCost = (index->tree_height + 1) * 50.0 * cpu_operator_cost; |
| 6869 | + descentCost = (index->tree_height + 1) * DEFAULT_PAGE_CPU_MULTIPLIER * cpu_operator_cost; |
6869 | 6870 | costs.indexStartupCost += descentCost;
|
6870 | 6871 | costs.indexTotalCost += costs.num_sa_scans * descentCost;
|
6871 | 6872 |
|
@@ -7060,7 +7061,7 @@ gistcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
|
7060 | 7061 | /*
|
7061 | 7062 | * Likewise add a per-page charge, calculated the same as for btrees.
|
7062 | 7063 | */
|
7063 |
| - descentCost = (index->tree_height + 1) * 50.0 * cpu_operator_cost; |
| 7064 | + descentCost = (index->tree_height + 1) * DEFAULT_PAGE_CPU_MULTIPLIER * cpu_operator_cost; |
7064 | 7065 | costs.indexStartupCost += descentCost;
|
7065 | 7066 | costs.indexTotalCost += costs.num_sa_scans * descentCost;
|
7066 | 7067 |
|
@@ -7115,7 +7116,7 @@ spgcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
|
7115 | 7116 | /*
|
7116 | 7117 | * Likewise add a per-page charge, calculated the same as for btrees.
|
7117 | 7118 | */
|
7118 |
| - descentCost = (index->tree_height + 1) * 50.0 * cpu_operator_cost; |
| 7119 | + descentCost = (index->tree_height + 1) * DEFAULT_PAGE_CPU_MULTIPLIER * cpu_operator_cost; |
7119 | 7120 | costs.indexStartupCost += descentCost;
|
7120 | 7121 | costs.indexTotalCost += costs.num_sa_scans * descentCost;
|
7121 | 7122 |
|
|
0 commit comments