From c86100fa49e93c9c25755b3311c8d0b4ba086d9b Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:26:36 -0400 Subject: [PATCH] Update README.md Add new parameters for a few of the procedures --- README.md | 111 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 8d5d56b..1a52b87 100644 --- a/README.md +++ b/README.md @@ -52,18 +52,22 @@ For a video walkthrough of the script and the results, [head over here](https:// Current valid parameter details: -| parameter_name | data_type | description | valid_inputs | defaults | -|----------------------------|-----------|----------------------------------------------------|------------------------------------------------------|--------------| -| @what_to_check | nvarchar | areas to check for pressure | "all", "cpu", and "memory" | both | -| @skip_queries | bit | if you want to skip looking at running queries | 0 or 1 | 0 | -| @skip_plan_xml | bit | if you want to skip getting plan XML | 0 or 1 | 0 | -| @minimum_disk_latency_ms | smallint | low bound for reporting disk latency | a reasonable number of milliseconds for disk latency | 100 | -| @cpu_utilization_threshold | smallint | low bound for reporting cpu utlization | a reasonable cpu utlization percentage | 50 | -| @skip_waits | bit | skips waits when you do not need them on every run | NULL, 0, 1 | NULL | -| @help | bit | how you got here | 0 or 1 | 0 | -| @debug | bit | prints dynamic sql | 0 or 1 | 0 | -| @version | varchar | OUTPUT; for support | none | none; OUTPUT | -| @version_date | datetime | OUTPUT; for support | none | none; OUTPUT | +| parameter_name | data_type | description | valid_inputs | defaults | +|----------------------------|-----------|--------------------------------------------------------------------------------|------------------------------------------------------|--------------| +| @what_to_check | varchar | areas to check for pressure | "all", "cpu", and "memory" | all | +| @skip_queries | bit | if you want to skip looking at running queries | 0 or 1 | 0 | +| @skip_plan_xml | bit | if you want to skip getting plan XML | 0 or 1 | 0 | +| @minimum_disk_latency_ms | smallint | low bound for reporting disk latency | a reasonable number of milliseconds for disk latency | 100 | +| @cpu_utilization_threshold | smallint | low bound for reporting high cpu utlization | a reasonable cpu utlization percentage | 50 | +| @skip_waits | bit | skips waits when you do not need them on every run | 0 or 1 | 0 | +| @skip_perfmon | bit | skips perfmon counters when you do not need them on every run | 0 or 1 | 0 | +| @sample_seconds | tinyint | take a sample of your server's metrics | a valid tinyint: 0-255 | 0 | +| @help | bit | how you got here | 0 or 1 | 0 | +| @debug | bit | prints dynamic sql, displays parameter and variable values, and table contents | 0 or 1 | 0 | +| @version | varchar | OUTPUT; for support | none | none; OUTPUT | +| @version_date | datetime | OUTPUT; for support | none | none; OUTPUT | + + [*Back to top*](#navigatory) @@ -230,44 +234,50 @@ More resources: Current valid parameter details: -| parameter_name | data_type | description | valid_inputs | defaults | -|---------------------------|----------------|--------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|--------------------------------------------------| -| @database_name | sysname | the name of the database you want to look at query store in | a database name with query store enabled | NULL; current non-system database name if NULL | -| @sort_order | varchar | the runtime metric you want to prioritize results by | cpu, logical reads, physical reads, writes, duration, memory, tempdb, executions | cpu | -| @top | bigint | the number of queries you want to pull back | a positive integer between 1 and 9,223,372,036,854,775,807 | 10 | -| @start_date | datetimeoffset | the begin date of your search, will be converted to UTC internally | January 1, 1753, through December 31, 9999 | the last seven days | -| @end_date | datetimeoffset | the end date of your search, will be converted to UTC internally | January 1, 1753, through December 31, 9999 | NULL | -| @timezone | sysname | user specified time zone to override dates displayed in results | SELECT tzi.* FROM sys.time_zone_info AS tzi; | NULL | -| @execution_count | bigint | the minimum number of executions a query must have | a positive integer between 1 and 9,223,372,036,854,775,807 | NULL | -| @duration_ms | bigint | the minimum duration a query must have to show up in results | a positive integer between 1 and 9,223,372,036,854,775,807 | NULL | -| @execution_type_desc | nvarchar | the type of execution you want to filter by (success, failure) | regular, aborted, exception | NULL | -| @procedure_schema | sysname | the schema of the procedure you're searching for | a valid schema in your database | NULL; dbo if NULL and procedure name is not NULL | -| @procedure_name | sysname | the name of the programmable object you're searching for | a valid programmable object in your database | NULL | -| @include_plan_ids | nvarchar | a list of plan ids to search for | a string; comma separated for multiple ids | NULL | -| @include_query_ids | nvarchar | a list of query ids to search for | a string; comma separated for multiple ids | NULL | -| @include_query_hashes | nvarchar | a list of query hashes to search for | a string; comma separated for multiple hashes | NULL | -| @include_plan_hashes | nvarchar | a list of query plan hashes to search for | a string; comma separated for multiple hashes | NULL | -| @include_sql_handles | nvarchar | a list of sql handles to search for | a string; comma separated for multiple handles | NULL | -| @ignore_plan_ids | nvarchar | a list of plan ids to ignore | a string; comma separated for multiple ids | NULL | -| @ignore_query_ids | nvarchar | a list of query ids to ignore | a string; comma separated for multiple ids | NULL | -| @ignore_query_hashes | nvarchar | a list of query hashes to ignore | a string; comma separated for multiple hashes | NULL | -| @ignore_plan_hashes | nvarchar | a list of query plan hashes to ignore | a string; comma separated for multiple hashes | NULL | -| @ignore_sql_handles | nvarchar | a list of sql handles to ignore | a string; comma separated for multiple handles | NULL | -| @query_text_search | nvarchar | query text to search for | a string; leading and trailing wildcards will be added if missing | NULL | -| @wait_filter | varchar | wait category to search for; category details are below | cpu, lock, latch, buffer latch, buffer io, log io, network io, parallelism, memory | NULL | -| @query_type | varchar | filter for only ad hoc queries or only from queries from modules | ad hoc, adhoc, proc, procedure, whatever. | NULL | -| @expert_mode | bit | returns additional columns and results | 0 or 1 | 0 | -| @format_output | bit | returns numbers formatted with commas | 0 or 1 | 1 | -| @get_all_databases | bit | looks for query store enabled databases and returns combined results from all of them | 0 or 1 | 0 | -| @workdays | bit | use this to filter out weekends and after-hours queries | 0 or 1 | 0 | -| @work_start | time | use this to set a specific start of your work days | a "time" like 8am, 9am or something | 9am | -| @work_end | time | use this to set a specific end of your work days | a "time" like 5pm, 6pm or something | 5pm | -| @help | bit | how you got here | 0 or 1 | 0 | -| @debug | bit | prints dynamic sql, statement length, parameter and variable values, and raw temp table contents | 0 or 1 | 0 | -| @troubleshoot_performance | bit | set statistics xml on for queries against views | 0 or 1 | 0 | -| @version | varchar | OUTPUT; for support | none; OUTPUT | none; OUTPUT | -| @version_date | datetime | OUTPUT; for support | none; OUTPUT | none; OUTPUT | - +| parameter_name | data_type | description | valid_inputs | defaults | +|-----------------------------------------|----------------|-------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|--------------------------------------------------| +| @database_name | sysname | the name of the database you want to look at query store in | a database name with query store enabled | NULL; current non-system database name if NULL | +| @sort_order | varchar | the runtime metric you want to prioritize results by | cpu, logical reads, physical reads, writes, duration, memory, tempdb, executions, recent | cpu | +| @top | bigint | the number of queries you want to pull back | a positive integer between 1 and 9,223,372,036,854,775,807 | 10 | +| @start_date | datetimeoffset | the begin date of your search, will be converted to UTC internally | January 1, 1753, through December 31, 9999 | the last seven days | +| @end_date | datetimeoffset | the end date of your search, will be converted to UTC internally | January 1, 1753, through December 31, 9999 | NULL | +| @timezone | sysname | user specified time zone to override dates displayed in results | SELECT tzi.* FROM sys.time_zone_info AS tzi; | NULL | +| @execution_count | bigint | the minimum number of executions a query must have | a positive integer between 1 and 9,223,372,036,854,775,807 | NULL | +| @duration_ms | bigint | the minimum duration a query must have to show up in results | a positive integer between 1 and 9,223,372,036,854,775,807 | NULL | +| @execution_type_desc | nvarchar | the type of execution you want to filter by (success, failure) | regular, aborted, exception | NULL | +| @procedure_schema | sysname | the schema of the procedure you're searching for | a valid schema in your database | NULL; dbo if NULL and procedure name is not NULL | +| @procedure_name | sysname | the name of the programmable object you're searching for | a valid programmable object in your database | NULL | +| @include_plan_ids | nvarchar | a list of plan ids to search for | a string; comma separated for multiple ids | NULL | +| @include_query_ids | nvarchar | a list of query ids to search for | a string; comma separated for multiple ids | NULL | +| @include_query_hashes | nvarchar | a list of query hashes to search for | a string; comma separated for multiple hashes | NULL | +| @include_plan_hashes | nvarchar | a list of query plan hashes to search for | a string; comma separated for multiple hashes | NULL | +| @include_sql_handles | nvarchar | a list of sql handles to search for | a string; comma separated for multiple handles | NULL | +| @ignore_plan_ids | nvarchar | a list of plan ids to ignore | a string; comma separated for multiple ids | NULL | +| @ignore_query_ids | nvarchar | a list of query ids to ignore | a string; comma separated for multiple ids | NULL | +| @ignore_query_hashes | nvarchar | a list of query hashes to ignore | a string; comma separated for multiple hashes | NULL | +| @ignore_plan_hashes | nvarchar | a list of query plan hashes to ignore | a string; comma separated for multiple hashes | NULL | +| @ignore_sql_handles | nvarchar | a list of sql handles to ignore | a string; comma separated for multiple handles | NULL | +| @query_text_search | nvarchar | query text to search for | a string; leading and trailing wildcards will be added if missing | NULL | +| @escape_brackets | bit | Set this bit to 1 to search for query text containing square brackets (common in .NET Entity Framework and other ORM queries) | 0 or 1 | 0 | +| @escape_character | nchar | Sets the ESCAPE character for special character searches, defaults to the SQL standard backslash (\) character | some escape character, SQL standard is backslash (\) | \ | +| @only_queries_with_hints | bit | only return queries with query hints | 0 or 1 | 0 | +| @only_queries_with_feedback | bit | only return queries with query feedback | 0 or 1 | 0 | +| @only_queries_with_variants | bit | only return queries with query variants | 0 or 1 | 0 | +| @only_queries_with_forced_plans | bit | only return queries with forced plans | 0 or 1 | 0 | +| @only_queries_with_forced_plan_failures | bit | only return queries with forced plan failures | 0 or 1 | 0 | +| @wait_filter | varchar | wait category to search for; category details are below | cpu, lock, latch, buffer latch, buffer io, log io, network io, parallelism, memory | NULL | +| @query_type | varchar | filter for only ad hoc queries or only from queries from modules | ad hoc, adhoc, proc, procedure, whatever. | NULL | +| @expert_mode | bit | returns additional columns and results | 0 or 1 | 0 | +| @format_output | bit | returns numbers formatted with commas | 0 or 1 | 1 | +| @get_all_databases | bit | looks for query store enabled databases and returns combined results from all of them | 0 or 1 | 0 | +| @workdays | bit | use this to filter out weekends and after-hours queries | 0 or 1 | 0 | +| @work_start | time | use this to set a specific start of your work days | a time like 8am, 9am or something | 9am | +| @work_end | time | use this to set a specific end of your work days | a time like 5pm, 6pm or something | 5pm | +| @help | bit | how you got here | 0 or 1 | 0 | +| @debug | bit | prints dynamic sql, statement length, parameter and variable values, and raw temp table contents | 0 or 1 | 0 | +| @troubleshoot_performance | bit | set statistics xml on for queries against views | 0 or 1 | 0 | +| @version | varchar | OUTPUT; for support | none; OUTPUT | none; OUTPUT | +| @version_date | datetime | OUTPUT; for support | none; OUTPUT | none; OUTPUT | [*Back to top*](#navigatory) @@ -308,6 +318,7 @@ Current valid parameter details: | @wait_duration_ms | bigint | minimum wait duration | the minimum duration of a wait for queries with interesting waits | 0 | | @wait_round_interval_minutes | bigint | interval to round minutes to for wait stats | interval to round minutes to for top wait stats by count and duration | 60 | | @skip_locks | bit | skip the blocking and deadlocking section | 0 or 1 | 0 | +| @pending_task_threshold | int | minimum number of pending tasks to display | a valid integer | 10 | | @debug | bit | prints dynamic sql, selects from temp tables | 0 or 1 | 0 | | @help | bit | how you got here | 0 or 1 | 0 | | @version | varchar | OUTPUT; for support | none | none; OUTPUT |