MCPcopy Index your code
hub / github.com/GraphLite-AI/GraphLite / cache_query_plan

Method cache_query_plan

graphlite/src/cache/cache_manager.rs:309–329  ·  view source on GitHub ↗

Cache compiled query plan

(
        &self,
        query_hash: u64,
        optimization_level: &str,
        hints: Vec<String>,
        logical_plan: LogicalPlan,
        physical_plan: PhysicalPlan,
        trace: Option<Pl

Source from the content-addressed store, hash-verified

307
308 /// Cache compiled query plan
309 pub fn cache_query_plan(
310 &self,
311 query_hash: u64,
312 optimization_level: &str,
313 hints: Vec<String>,
314 logical_plan: LogicalPlan,
315 physical_plan: PhysicalPlan,
316 trace: Option<PlanTrace>,
317 compilation_time: Duration,
318 ) {
319 if !self.config.enabled {
320 return;
321 }
322
323 let schema_version = *self.schema_version.read().unwrap();
324 let key = create_plan_cache_key(query_hash, schema_version, optimization_level, hints);
325
326 self.plan_cache
327 .insert(key, logical_plan, physical_plan, trace, compilation_time);
328 self.update_global_stats();
329 }
330
331 /// Get cached subquery result
332 pub fn get_subquery_result(

Callers

nothing calls this directly

Calls 4

create_plan_cache_keyFunction · 0.85
unwrapMethod · 0.80
update_global_statsMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected