/src/duckdb/src/execution/physical_plan/plan_prepare.cpp
Line | Count | Source |
1 | | #include "duckdb/execution/operator/scan/physical_dummy_scan.hpp" |
2 | | #include "duckdb/execution/physical_plan_generator.hpp" |
3 | | #include "duckdb/planner/operator/logical_prepare.hpp" |
4 | | #include "duckdb/execution/operator/helper/physical_prepare.hpp" |
5 | | |
6 | | namespace duckdb { |
7 | | |
8 | 4.53k | PhysicalOperator &PhysicalPlanGenerator::CreatePlan(LogicalPrepare &op) { |
9 | | // Generate the physical plan only if all parameters are bound. |
10 | | // Otherwise, the physical plan is never used. |
11 | 4.53k | D_ASSERT(op.children.size() <= 1); |
12 | 4.53k | if (op.prepared->properties.bound_all_parameters && !op.children.empty()) { |
13 | 1.96k | PhysicalPlanGenerator inner_planner(context); |
14 | 1.96k | op.prepared->physical_plan = inner_planner.PlanInternal(*op.children[0]); |
15 | 1.96k | op.prepared->types = op.prepared->physical_plan->Root().types; |
16 | 1.96k | } |
17 | 4.53k | return Make<PhysicalPrepare>(op.name, std::move(op.prepared), op.estimated_cardinality); |
18 | 4.53k | } |
19 | | |
20 | | } // namespace duckdb |