From 28cafa44202e7f89aca5f21ce539cb54bc022828 Mon Sep 17 00:00:00 2001 From: Max Gabrielsson Date: Mon, 4 Nov 2024 13:22:35 +0100 Subject: [PATCH] calculate cardinality after setting function pointer in rtree scan --- spatial/src/spatial/core/index/rtree/rtree_index_plan_scan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spatial/src/spatial/core/index/rtree/rtree_index_plan_scan.cpp b/spatial/src/spatial/core/index/rtree/rtree_index_plan_scan.cpp index b4202339..65f5c189 100644 --- a/spatial/src/spatial/core/index/rtree/rtree_index_plan_scan.cpp +++ b/spatial/src/spatial/core/index/rtree/rtree_index_plan_scan.cpp @@ -193,8 +193,8 @@ class RTreeIndexScanOptimizer : public OptimizerExtension { } // If there are no table filters pushed down into the get, we can just replace the get with the index scan - const auto cardinality = get.function.cardinality(context, bind_data.get()); get.function = RTreeIndexScanFunction::GetFunction(); + const auto cardinality = get.function.cardinality(context, bind_data.get()); get.has_estimated_cardinality = cardinality->has_estimated_cardinality; get.estimated_cardinality = cardinality->estimated_cardinality; get.bind_data = std::move(bind_data);