Skip to main content

Module profile

Module profile 

Source
Expand description

Bounded profiling: turn a SQL dump’s column values into fixed-size, generator-neutral evidence.

The profiler scans data and accumulates bounded sketches (ColumnSketches) whose memory does not grow with input size — a column spanning a billion rows costs the same as one spanning a thousand. The result is a tree of neutral evidence structs: observations and confidence only, with no opinion about how to regenerate the data. Later stages (schema inference, generation heuristics) consume that evidence without depending on how it was collected.

The three properties this module guarantees, enforced by tests/generate_profile_test.rs:

  • Bounded — retained items and bytes stay within the ProfileBudget.
  • Mergeable — sketches over disjoint partitions merge into the same bounded evidence as a single pass (exactly, for the non-sampled parts).
  • Seeded — the same seed yields the same reservoir sample.

Re-exports§

pub use evidence::BooleanEvidence;
pub use evidence::CharClasses;
pub use evidence::ColumnEvidence;
pub use evidence::DumpProfile;
pub use evidence::NumericEvidence;
pub use evidence::RelationshipEvidence;
pub use evidence::StringShapeEvidence;
pub use evidence::TableEvidence;
pub use evidence::TimestampRangeEvidence;
pub use evidence::TopKEntry;
pub use heuristics::Confidence;
pub use heuristics::Decision;
pub use heuristics::InferenceError;
pub use heuristics::InferenceOptions;
pub use heuristics::InferenceResult;
pub use heuristics::ModelInference;
pub use heuristics::Precedence;
pub use heuristics::RejectedCandidate;

Modules§

evidence
Neutral profiling evidence: observations and confidence only.
heuristics
Turn a neutral DumpProfile into an explicit, self-contained SyntheticModel through a set of small, registered heuristics.

Structs§

ColumnSketches
All per-column accumulators bundled behind one seeded, mergeable, bounded facade. Feed values with observe; combine partitions with merge; finalize to ColumnEvidence with finish.
DumpProfiler
Streams a SQL dump into a DumpProfile. Build one with DumpProfiler::builder.
DumpProfilerBuilder
Builder for DumpProfiler.
ProfileBudget
Per-column bounds on how much the profiler may retain. Every accumulator is sized from these three knobs; the derived methods report the resulting item and byte ceilings.

Enums§

ProfileDepth
How deeply to profile a dump.
ProfileError
Errors from building or combining profile evidence.
ProfileValue
A single observed column value, borrowed for the duration of the call.