Updates_20260901 - Permission to Come Aboard - #862
Merged
Merged
Conversation
…ry (#850) The #plan_ids_with_total_waits inserts joined query_store_runtime_stats to query_store_wait_stats on plan_id alone, so the date range only decided which plans qualified while the wait numbers came from every interval the plan ever ran in. The 'total waits' branch also multiplied that all-history total by the number of in-window runtime stats rows. Joining on runtime_stats_interval_id and execution_type scopes waits to the qualified rows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…al-join Fix wait sort orders counting waits across all of Query Store history (#850)
The #wait_filter populate aggregated query_store_wait_stats with no date restriction, so queries whose waits happened entirely outside the requested window still passed the filter, and the TOP was ranked by all-history wait totals. Joining to query_store_runtime_stats on (plan_id, runtime_stats_interval_id, execution_type) and filtering last_execution_time by the date range matches the semantics of the main where clause and the wait sort order joins from #851. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rval-scope Fix @wait_filter matching waits from all of Query Store history (#852)
…t-order sp_QuickieStore: added the 'log' and 'total log' sort orders
* add database filtering to metrics gathering queries #856 * formatting changes per PR #856 * remove extra whitespace before @SQL * found more whitespace differences * yet more whitespace differences, I think I got them all this time * sp_PerfCheck: scope the IO stall DMV call, drop trailing whitespace Pass @filter_database_id into sys.dm_io_virtual_file_stats for @io_sql the way @file_io_sql already does, so the DMV returns one database's files instead of every file on the instance for the WHERE to discard. The WHERE branch becomes 1 = 1 for the same reason the Azure branch is. Correct the trailing comment: with @database_name set the result is one database, tempdb included only when that is the database asked for. --------- Co-authored-by: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com>
* Add override for system admin check (@skip_sysadmin_check) #858 * switch to can_read check provided in feature comment #858 * sp_LogHunter: read the current log when archives cannot be enumerated Swapping the sysadmin test for a real permission check gets a caller with EXECUTE on xp_readerrorlog past line 178, and then sp_enumerrorlogs fails them with 27219 because it wants securityadmin. A GRANT does not help - it checks the role itself - and HAS_PERMS_BY_NAME reports 1 for it regardless, so it cannot be gated the same way. Enumerating archives is a convenience. Catch 27219, fall back to the current log, and say so. --------- Co-authored-by: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Updates_20260901 release prep: version bumps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates_20260901— Permission to Come Aboard.All ten procs move to
.9, version date20260901.sp_LogHunter stops asking the wrong question
sp_LogHunter refused to run for anyone who was not
sysadmin, which was never the permission it actually needed.xp_readerrorlogcan be granted withGRANT EXECUTE, and an account holding that grant read the log perfectly well whileIS_SRVROLEMEMBER(N'sysadmin')answered no and the proc bailed out.HAS_PERMS_BY_NAME(N'master.dbo.xp_readerrorlog', N'OBJECT', N'EXECUTE')— the permission the procedure uses, asked about directly. The error message names it too, so a failure tells you what to grant.sp_enumerrorlogs, which enumerates the archived logs, is a separate problem: it checks membership in securityadmin itself, and noGRANTsubstitutes for that. Rather than failing the whole run on error 27219, sp_LogHunter now catches it, reads the current log — whichxp_readerrorlogcan still do — and says so.Verified on the reporter's exact permission set, which also proved nothing else in the procedure needs elevation. (#858, #859)
sp_QuickieStore
@find_parameter_sensitivereworked against a production fleet (#854). Ranking is now work-weighted: coefficient of variation alone is scale-blind, and a 3ms→60ms swing was out-ranking a 2s→40s one. On one tenant the window CPU represented by the surfaced top 15 went from 295s to 4,170s. Also: the hash include/ignore lists are honored inside the mode,mixed swingsfills a classification gap that left 25 of 162 surfaced shapes with a blank verdict, ratio displays cap at9999+instead of printing2850350x, and the summary now distinguishes "no waits" from "wait capture is off" rather than silently omitting the column.Two wait-accounting fixes that both understated nothing and overstated everything.
@wait_filtermatched waits from all of Query Store history rather than the interval asked for (#852), and the wait sort orders counted across all of history the same way (#850).New
logandtotal logsort orders (#819, thanks @ReeceGoding).sp_PerfCheck
@database_namenarrowed the summary but not the per-file I/O detail, so a filtered run still returned files from every database on the instance — 16 rows where 2 were asked for. The filter is now applied at thesys.dm_io_virtual_file_statscall itself, matching how the Azure SQL DB path already worked, instead of in aWHEREclause that the detail query never had. (#856, #860 — thanks @jbelina)