You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A new orthogonal axis on Implementation/SummaryFamilyType, alongside SketchKind/SamplingKind/WaveletKind/StatModelKind: how a grouped aggregate's summary state is physically instantiated across its by subpopulations.
/// Orthogonal to which summary family/kind is chosen — how many physical/// instances of it exist across a grouped aggregate's subpopulations.#[derive(Debug,Clone,PartialEq)]pubenumGroupingStrategy{/// Today's only (implicit) behavior: one summary instance per distinct/// `by` key.PerSubpopulationInstance,/// One shared structure serving every subpopulation (Hydra and its/// per-family variants — HydraKLL, HydraCMS, HydraHLL, HydraUnivMon,/// per the existing `hydra_*` wrappers in this org's sketch-bench).SharedMultiSubpopulation{kind:HydraKind,params:HydraParams},}
(Named SharedMultiSubpopulation, not SharedMultiTenant — this is sharing across the query's own subpopulations/group-by keys, not multi-tenant in the deployment-isolation sense.)
HydraKind/HydraParams mirror the existing per-family (Kind, Params) pattern (SketchKind/SketchParams, etc. in asap_types::post_asap).
Exposed as another ReplacementStrategy (see that sub-issue): candidates() only produces a SharedMultiSubpopulation alternative when by is non-empty (empty by has no subpopulation axis at all) and a Hydra variant exists for the chosen family.
Legality, not cost: whether Hydra is worth it for a given estimated subpopulation cardinality is a cost-model question (deployment-owned, out of scope here); whether it's valid at all (non-empty by, family has a Hydra variant) is what this issue's strategy must gate correctly, same split boundary::implementation_for already draws between "can this be built" and "should it be."
Must call the roll-up sub-issue's merge-legality predicate before offering a SharedMultiSubpopulation candidate as either side of a roll-up substitution, rather than assuming every combination composes.
Part of #33.
What
A new orthogonal axis on
Implementation/SummaryFamilyType, alongsideSketchKind/SamplingKind/WaveletKind/StatModelKind: how a grouped aggregate's summary state is physically instantiated across itsbysubpopulations.(Named
SharedMultiSubpopulation, notSharedMultiTenant— this is sharing across the query's own subpopulations/group-by keys, not multi-tenant in the deployment-isolation sense.)HydraKind/HydraParamsmirror the existing per-family(Kind, Params)pattern (SketchKind/SketchParams, etc. inasap_types::post_asap).Where it plugs in
Implementation::Sketch/Sample/Waveleteach grow agrouping: GroupingStrategyfield (a breaking change to those variants — scoped as its own issue for exactly that reason, per the discussion on Add logic to detect which optimizations are applicable to a query workload #33).ReplacementStrategy(see that sub-issue):candidates()only produces aSharedMultiSubpopulationalternative whenbyis non-empty (emptybyhas no subpopulation axis at all) and a Hydra variant exists for the chosen family.by, family has a Hydra variant) is what this issue's strategy must gate correctly, same splitboundary::implementation_foralready draws between "can this be built" and "should it be."SharedMultiSubpopulationcandidate as either side of a roll-up substitution, rather than assuming every combination composes.