Thor Logo dbatools

Performance

Get-DbaQueryExecutionTime

Brandon Abshire, netnerds.net

Get-DbaQueryExecutionTime View Source Brandon Abshire, netnerds.net Windows, Linux, macOS Synopsis Retrieves stored procedures and SQL statements with the highest CPU execution times from SQL Server instances. Description Analyzes SQL Server’s query execution statistics to identify performance bottlenecks by examining CPU worker time data from dynamic management views. This function queries sys.dm_exec_procedure_stats for stored procedures and sys.dm_exec_query_stats for ad hoc statements, returning detailed execution metrics including average execution time, total executions, and maximum execution time.

Read more

Get-DbaTopResourceUsage

Chrissy LeMaire (@cl), netnerds.net

Get-DbaTopResourceUsage View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Identifies the most resource-intensive cached queries from sys.dm_exec_query_stats for performance troubleshooting Description Analyzes cached query performance by examining sys.dm_exec_query_stats to find your worst-performing queries across four key metrics: total duration, execution frequency, IO operations, and CPU time. Each metric returns the top consumers (default 20) grouped by query hash, so you can quickly spot patterns in problematic queries that are dragging down server performance.

Read more

Import-DbaPfDataCollectorSetTemplate

Chrissy LeMaire (@cl), netnerds.net

Import-DbaPfDataCollectorSetTemplate View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Creates Windows Performance Monitor data collector sets with SQL Server-specific performance counters from predefined templates. Description Creates Windows Performance Monitor data collector sets using XML templates containing SQL Server performance counters. This eliminates the need to manually configure dozens of performance counters through the Performance Monitor GUI. The function can use built-in templates from the dbatools repository (like ‘Long Running Query’ or ‘db_ola_health’) or custom XML template files you specify.

Read more

Invoke-DbaDbClone

Chrissy LeMaire (@cl), netnerds.net

Invoke-DbaDbClone View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Creates lightweight database clones containing schema and statistics but no table data Description Creates schema-only database clones using SQL Server’s DBCC CLONEDATABASE command. The cloned database contains all database objects (tables, indexes, views, procedures) and statistics, but no actual table data. This is particularly valuable for performance troubleshooting scenarios where you need to analyze query execution plans and optimizer behavior without the storage overhead of copying entire tables.

Read more

Invoke-DbaPfRelog

Chrissy LeMaire (@cl), netnerds.net

Invoke-DbaPfRelog View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Pipeline-compatible wrapper for the relog command which is available on modern Windows platforms. Description Pipeline-compatible wrapper for the relog command. Relog is useful for converting Windows Perfmon. Extracts performance counters from performance counter logs into other formats, such as text-TSV (for tab-delimited text), text-CSV (for comma-delimited text), binary-BIN, or SQL. relog "C:\PerfLogs\Admin\System Correlation\WORKSTATIONX_20180112-000001\DataCollector01.blg" -o C:\temp\foo.csv -f tsv If you find any input hangs, please send us the output so we can accommodate for it then use -Raw for an immediate solution.

Read more

Test-DbaDiskSpeed

Chrissy LeMaire (@cl), netnerds.net

Test-DbaDiskSpeed View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Analyzes database file I/O performance and identifies storage bottlenecks using SQL Server DMV statistics Description Queries sys.dm_io_virtual_file_stats to measure read/write latency, throughput, and overall I/O performance for database files. Returns performance ratings from “Very Good” to “Serious I/O Bottleneck” based on average stall times, helping you quickly identify storage issues that impact SQL Server performance. Can aggregate results by individual file, database, or disk level to pinpoint exactly where I/O problems exist.

Read more

Test-DbaNetworkLatency

Chrissy LeMaire (@cl), netnerds.net

Test-DbaNetworkLatency View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Tests how long a query takes to return from SQL Server Description This function is intended to help measure SQL Server network latency by establishing a connection and executing a simple query. This is a better than a simple ping because it actually creates the connection to the SQL Server and measures the time required for only the entire routine, but the duration of the query as well how long it takes for the results to be returned.

Read more
← Previous
1 2
Next →
Page 2 of 2