MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / planSingleQuery

Method planSingleQuery

src/planner/plan/plan_single_query.cpp:13–27  ·  view source on GitHub ↗

Note: we cannot append ResultCollector for plans enumerated for single query before there could be a UNION on top which requires further flatten. So we delay ResultCollector appending to enumerate regular query level.

Source from the content-addressed store, hash-verified

11// be a UNION on top which requires further flatten. So we delay ResultCollector appending to
12// enumerate regular query level.
13LogicalPlan Planner::planSingleQuery(const NormalizedSingleQuery& singleQuery) {
14 auto propertyCollector = PropertyCollector();
15 propertyCollector.visitSingleQuery(singleQuery);
16 auto properties = propertyCollector.getProperties();
17 for (auto& expr : propertyCollector.getProperties()) {
18 auto& property = expr->constCast<PropertyExpression>();
19 propertyExprCollection.addProperties(property.getVariableName(), expr);
20 }
21 context.resetState();
22 auto plan = LogicalPlan();
23 for (auto i = 0u; i < singleQuery.getNumQueryParts(); ++i) {
24 planQueryPart(*singleQuery.getQueryPart(i), plan);
25 }
26 return plan;
27}
28
29void Planner::planQueryPart(const NormalizedQueryPart& queryPart, LogicalPlan& plan) {
30 // plan read

Callers

nothing calls this directly

Calls 8

addPropertiesMethod · 0.80
LogicalPlanClass · 0.50
visitSingleQueryMethod · 0.45
getPropertiesMethod · 0.45
getVariableNameMethod · 0.45
resetStateMethod · 0.45
getNumQueryPartsMethod · 0.45
getQueryPartMethod · 0.45

Tested by

no test coverage detected