MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / format_plan_node

Method format_plan_node

graphlite/src/plan/trace.rs:179–646  ·  view source on GitHub ↗

Format a single plan node with tree structure

(
        &self,
        node: &PhysicalNode,
        output: &mut String,
        depth: usize,
        is_last: bool,
    )

Source from the content-addressed store, hash-verified

177
178 /// Format a single plan node with tree structure
179 fn format_plan_node(
180 &self,
181 node: &PhysicalNode,
182 output: &mut String,
183 depth: usize,
184 is_last: bool,
185 ) {
186 // Tree connector
187 let prefix = if depth == 0 {
188 "".to_string()
189 } else {
190 let mut p = String::new();
191 for _i in 0..depth - 1 {
192 p.push_str("│ ");
193 }
194 if is_last {
195 p.push_str("└── ");
196 } else {
197 p.push_str("├── ");
198 }
199 p
200 };
201
202 match node {
203 PhysicalNode::NodeSeqScan {
204 variable,
205 labels,
206 estimated_rows,
207 estimated_cost,
208 ..
209 } => {
210 output.push_str(&format!(
211 "{}NodeScan[{}:{}] → {} rows, cost: {:.1}\n",
212 prefix,
213 variable,
214 labels.join("|"),
215 estimated_rows,
216 estimated_cost
217 ));
218 output.push_str(&format!(
219 "{} Variables: {}\n",
220 " ".repeat(prefix.len()),
221 variable
222 ));
223 if !labels.is_empty() {
224 output.push_str(&format!(
225 "{} Labels: {}\n",
226 " ".repeat(prefix.len()),
227 labels.join(", ")
228 ));
229 }
230 }
231 PhysicalNode::NodeIndexScan {
232 variable,
233 labels,
234 estimated_rows,
235 estimated_cost,
236 ..

Callers 1

format_graph_planMethod · 0.80

Calls 3

is_emptyMethod · 0.45
iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected