From 49e6a72d361e794bf1b74a45ce56e20f01001bd5 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sat, 10 Jun 2023 01:18:21 -0700 Subject: [PATCH] Remove cost of extra pages when random_page_cost equals seq_page_cost --- src/ivfflat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ivfflat.c b/src/ivfflat.c index 0a7eb8d..832d805 100644 --- a/src/ivfflat.c +++ b/src/ivfflat.c @@ -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)