Repository navigation
Document the minimum interval between Query Store size-based cleanups - #10496
Rudi Bruchez (rudi-bruchez) wants to merge 1 commit into
Conversation
|
Rudi Bruchez (@rudi-bruchez) : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
|
Learn Build status updates of commit c6aada7: ✅ Validation status: passed
For more details, please refer to the build report. |
|
Umachandar Jayachandran (@uc-msft) Can you review the proposed changes? Important: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
There was a problem hiding this comment.
🟢 Approval recommended
The documentation update clearly covers the SQL Server Query Store cleanup cooldown and the resulting read-only behavior, with no active review issues identified.
No open issues 🎉
What changed in this PR
Documents the minimum 15-minute interval between SQL Server Query Store size-based cleanup passes and explains why Query Store can remain read-only when the storage limit is reached again during that interval.
Changes:
- Updates the SQL Server
SIZE_BASED_CLEANUP_MODE = AUTOdescription. - Clarifies the read-only behavior until the next eligible cleanup.
| File | Description |
|---|---|
| docs/t-sql/statements/alter-database-transact-sql-set-options.md | Adds the size-based cleanup cooldown and read-only behavior to the SQL Server Query Store options documentation. |
Review effort: Lite
What's wrong
The
SIZE_BASED_CLEANUP_MODE = AUTOparagraph says that size-based cleanup "is automatically activated when size on disk reaches 90% of MAX_STORAGE_SIZE_MB", and theMAX_STORAGE_SIZE_MBsection says the cleanup "is also triggered" when the limit is breached. Neither says that a cleanup pass is followed by a minimum delay. When the store fills again within 15 minutes of a pass, cleanup does not run: Query Store stays inREAD_ONLY(readonly_reason65536) until 900 seconds have passed since the previous pass. Users who watch the store go read-only right after a cleanup have no way to tell from the page why it does not recover.Evidence
SQL Server 2022 CU27-GDR (16.0.4305.5) and SQL Server 2025 CU10 (17.0.5035.5), Developer edition, Linux containers. Also seen on SQL Server 2019 CU32-GDR. Two fresh databases,
MAX_STORAGE_SIZE_MB = 5, captureALL,SIZE_BASED_CLEANUP_MODE = AUTO,DATA_FLUSH_INTERVAL_SECONDS60 and 180,AUTO_CLOSE OFF.Observed, identical on 2022 and 2025: the first pass runs at 11:59:10 UTC in both databases. The limit is breached again at 12:00:22. From then on, every size check raises
query_store_size_retention_cleanup_skippedwithmin_repeat_period_seconds = 900andtime_since_last_cleanup_secondsgrowing (72, 131, ..., 851), and the store stays read-only. The next pass runs at 12:14:20 with a 60-second flush interval (900 s after the first), and at 12:16:20 with a 180-second flush interval (the first size check after 900 s).Expected per the current text: a cleanup each time the limit is breached.
Change
Adds two sentences to the
AUTOdescription ofSIZE_BASED_CLEANUP_MODEin the SQL Server section: cleanup runs at most once every 15 minutes, and a store that reaches the limit again before then stays read-only until the next cleanup. The Azure SQL Database and Managed Instance sections carry the same paragraph; I didn't measure there, so I left them unchanged.