Rindle docs and package mapSkip to main content

analyze_standalone

Function analyze_standalone 

Source
pub fn analyze_standalone(
    spec: &AnalyzeSpec,
    ast: &Ast,
) -> Result<AnalyzeReport, ReplicaError>
Expand description

Run one analyze query COLD on the calling thread over a private connection to spec.path, touching no engine, no worker, and no live statement cache.

This is the daemon’s /analyze entry point (run on a dedicated thread there): because everything is analysis-private — a fresh connection with the standard pragmas (open_journal — the same opener the workers use), fresh TableSources, a throwaway graph — a genuinely slow cold hydrate blocks only its own thread; commits, materializations, and control-plane commands proceed. Isolation also keeps the numbers honest: the scan-stats counters live on this connection’s private prepared statements, so a live cursor’s history can never inflate them. Under wal2 the pinned deferred read snapshot never blocks the writer.