Skip to content

Query Store windows longer than the raw tier stop at the raw floor on armed stores; read the interval table below it #4689

Closed

Description

@erikdarlingdata

On a store with the Query Store rollups armed, raw collect.query_store_stats keeps 4 days. collect.query_store_interval_wide keeps 9. Every reader of _wide bounds its table read at the raw floor (QueryStoreIntervalWide.ClampedStart = max(windowStart, rawFloor)). So a 7-day Query Store window shows only about 4 days of history, and the interval rows between 4 and 9 days old are stored but never read.

The change: for the part of a window below the raw floor, read the interval table alone. At or above the floor, reads stay as they are today (exact to raw). Plain stores keep raw for 30 days, so the clamp never binds and they don't change.

Requirements:

  • Exact: the below-floor answer must equal what raw returned before its purge. That's pinned by writing through the real write path, reading while raw still holds the rows, dropping raw below the floor, and reading again.
  • Disclosed: the interval table may not hold the whole window, because it started filling recently or its own retention trimmed it. Every reader reports the oldest interval actually present, and says when the requested window reaches past it. Unknown is reported as unknown, never as a made-up start.
  • Surfaces: get_query_store_top, the Viewer Queries grid, the Viewer duration trend, and the Compose query_store_stats panels.
  • No store schema change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions