diff --git a/src/core/operator/logical_path_finding_operator.cpp b/src/core/operator/logical_path_finding_operator.cpp index 8e403f5d..a7bdb689 100644 --- a/src/core/operator/logical_path_finding_operator.cpp +++ b/src/core/operator/logical_path_finding_operator.cpp @@ -8,8 +8,9 @@ namespace duckpgq { namespace core { unique_ptr LogicalPathFindingOperator::CreatePlan( - ClientContext &, duckdb::PhysicalPlanGenerator &generator) { + ClientContext &context, duckdb::PhysicalPlanGenerator &generator) { D_ASSERT(children.size() == 2); + estimated_cardinality = children[0]->EstimateCardinality(context); auto left = generator.CreatePlan(std::move(children[0])); auto right = generator.CreatePlan(std::move(children[1])); return make_uniq(*this, std::move(left), diff --git a/src/core/operator/physical_path_finding_operator.cpp b/src/core/operator/physical_path_finding_operator.cpp index c2b80308..8a4584b6 100644 --- a/src/core/operator/physical_path_finding_operator.cpp +++ b/src/core/operator/physical_path_finding_operator.cpp @@ -26,10 +26,11 @@ namespace core { PhysicalPathFinding::PhysicalPathFinding(LogicalExtensionOperator &op, unique_ptr left, unique_ptr right) - : PhysicalComparisonJoin(op, TYPE, {}, JoinType::INNER, 0) { + : PhysicalComparisonJoin(op, TYPE, {}, JoinType::INNER, op.estimated_cardinality) { children.push_back(std::move(left)); children.push_back(std::move(right)); expressions = std::move(op.expressions); + estimated_cardinality = op.estimated_cardinality; auto &path_finding_op = op.Cast(); mode = path_finding_op.mode; } @@ -306,7 +307,6 @@ PhysicalPathFinding::Finalize(Pipeline &pipeline, Event &event, context.TryGetCurrentSetting("experimental_path_finding_operator_task_size", task_size_value); gstate.global_bfs_state->split_size = task_size_value.GetValue(); - ; // Schedule the first round of BFS tasks if (all_pairs->size() > 0) { @@ -369,6 +369,14 @@ void PhysicalPathFinding::ScheduleBFSEvent(Pipeline &pipeline, Event &event, } } +string PhysicalPathFinding::ParamsToString() const { + std::cout << "ParamsToString" << std::endl; + auto result = mode; + result += "\n[INFOSEPARATOR]\n"; + result += StringUtil::Format("EC: %llu", estimated_cardinality); + return result; +} + //===--------------------------------------------------------------------===// // Operator //===--------------------------------------------------------------------===// diff --git a/src/include/duckpgq/core/operator/physical_path_finding_operator.hpp b/src/include/duckpgq/core/operator/physical_path_finding_operator.hpp index 3c84385a..458fa05a 100644 --- a/src/include/duckpgq/core/operator/physical_path_finding_operator.hpp +++ b/src/include/duckpgq/core/operator/physical_path_finding_operator.hpp @@ -117,6 +117,8 @@ class PhysicalPathFinding : public PhysicalComparisonJoin { public: + string ParamsToString() const override; + // CachingOperator Interface OperatorResultType ExecuteInternal(ExecutionContext &context, DataChunk &input, DataChunk &chunk,