Skip to content

Query Store ships GB-scale plan XML on catch-up and re-ships hot plans every cycle - add a per-database plan_id watermark #1960

Description

@erikdarlingdata

The third finding from the prod-sql-use2 field investigation, filed as a measured-decision marker per the reporter's own recommendation: NOT worth acting on blind.

The Query Store collector is already defended against the below-TOP TVF defect its siblings had (its expensive payloads are catalog COLUMNS via 1:1 joins, plan text dedupes to one copy per plan_id via the ROW_NUMBER CASE that composes with the TOP by design, and the @cutoff_time watermark bounds each cycle). The one theoretical exposure: the ROW_NUMBER window forces the joins plus the rn=1 plan-text conversion to evaluate for ALL qualifying rows BEFORE the TOP - so a pathological burst converts XML for every distinct plan in the window, including rows the TOP discards.

Burst-only, and unvalidatable on the reporting fleet (replicas serve zero QS rows). Tripwire: when a QS-BEARING store shows query_store sweep times out of family with its row counts, measure this exposure there first - the reporter's ab_test.py methodology (interleaved pairs, warmup discarded, row-identity parity) is the template. Do not restructure the QS read speculatively; its current shape's properties (dedup-compose-with-TOP) are load-bearing and pinned.

Activity

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

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions