From 25f97fd91d12ae970f01ef63283e9b55cd0f0055 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 22 Sep 2024 11:17:29 -0700 Subject: [PATCH] Updated cost estimation [skip ci] --- src/ivfflat.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ivfflat.c b/src/ivfflat.c index d8b4332..5c8c00f 100644 --- a/src/ivfflat.c +++ b/src/ivfflat.c @@ -131,10 +131,15 @@ ivfflatcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, probes = ivfflat_probes; if (ivfflat_streaming) + { probes = Max(probes, EstimateProbes(root, path, lists)); + if (ivfflat_max_probes != -1) + probes = Min(probes, ivfflat_max_probes); + } + /* Get the ratio of lists that we need to visit */ - ratio = ((double) ivfflat_probes) / lists; + ratio = ((double) probes) / lists; if (ratio > 1.0) ratio = 1.0;