Remove cost of extra pages when random_page_cost equals seq_page_cost

This commit is contained in:
Andrew Kane
2023-06-10 01:18:21 -07:00
parent b158a5fa48
commit 49e6a72d36

View File

@@ -118,7 +118,7 @@ ivfflatcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
/* Use total cost since most work happens before first tuple is returned */
startupCost = costs.indexTotalCost;
if (costs.spc_random_page_cost > spc_seq_page_cost)
if (costs.spc_random_page_cost >= spc_seq_page_cost)
{
/* Adjust cost if needed since TOAST not included in seq scan cost */
if (costs.numIndexPages > path->indexinfo->rel->pages && ratio < 0.5)