Skip to content

fix: keep compacted query attribution honest - #150

Closed
NikolayS wants to merge 2 commits into
mainfrom
release/fix-query-rollup-honesty-136
Closed

fix: keep compacted query attribution honest#150
NikolayS wants to merge 2 commits into
mainfrom
release/fix-query-rollup-honesty-136

Conversation

@NikolayS

Copy link
Copy Markdown
Owner

Closes #136

Summary

  • keep preserved named query IDs useful on rollup-backed top('query_id') reads
  • add a NULL residual for uncaptured and compacted-away attribution so backend_seconds and pct reconcile to total AAS
  • force raw samples for every explicit query_id filter in aas, timeline, top, and inherited compare paths
  • continue forcing raw for query breakdowns combined with wait filters
  • document minute-threshold/hourly-top-set compaction and exact-vs-approximate query semantics throughout the 2.0 API docs

TDD evidence

A real packed sample contains 26 backend appearances: q111=3, q222=2, q333=1, and NULL=20. With rollup_min_backend_seconds = 3, the stored minute query_counts is only [111,3].

Before the fix, rollup-backed top('query_id') reported q111 as 3 seconds and 100% of query load. After the fix it reports:

  • q111: 3 seconds, 11.54%
  • NULL residual: 23 seconds, 88.46%
  • total: 26 seconds, 100%

An independent hourly-rollup fixture produced the same reconciliation after hourly top-set compaction.

Validation

Postgres 18:

The hosted PG14–PG19 beta and no-cron matrix is left to this draft PR.

@NikolayS

Copy link
Copy Markdown
Owner Author

Superseded by #198, which recovered the #136 compacted-query-attribution rework on current main and landed it as 6d72583. Closing this older attempt in favor of that successor.

@NikolayS NikolayS closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: compacted query rollups are presented as exact AAS

1 participant