Skip to content

Optimizer: infer N_g from an external dataset #693

Closed as not planned
Closed as not planned

Description

@milindsrivastava1997

Goal

Provide the optimizer with real label-group cardinality N_g from an explicit external dataset, without contacting Prometheus.

Scope

  • Require a dataset input for the greedy optimizer CLI.
  • Define a canonical series-inventory format: one row per metric series, with metric and label columns.
  • For each profile key (metric, spatial_filter, grouping_labels), count distinct grouping-label tuples after applying the filter.
  • Treat an empty grouping-label set as N_g = 1.
  • Deduplicate raw samples by series identity if sample-level data is supported.
  • Pass the resulting count into CandidateConfig and use it for non-subpopulation-aware ingest/query costs.
  • Keep subpopulation-aware candidates at N_g = 1.
  • Fail clearly when the dataset does not cover a required profile; never interpret missing data as N_g = 0.
  • Keep the dataset loader separate from the optimizer core so an equivalent Prometheus-backed provider can be added later.

Tests

  • Distinct counts for empty, single-label, and multi-label groupings.
  • Spatial-filter handling.
  • Repeated samples do not inflate cardinality.
  • Missing profile coverage produces a clear error.
  • Offline CLI and in-memory test fixtures work without Prometheus.

Activity

  1. removed their assignment
    on Oct 7, 2026
  2. milindsrivastava1997 commented on Oct 27, 2026

    @milindsrivastava1997
    ContributorAuthor

    Superseded by the rqe-optimizer MILP path (#790, ProjectASAP/sketch-bench#129, #794); the greedy optimizer was removed in #807. Duplicate of #525 (facts inference for the MILP's --workload-facts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions