Thor Logo dbatools

Statistics

Get-DbaDbccStatistic

Patrick Flynn (@sqllensman)

Get-DbaDbccStatistic View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves statistics information from tables and indexed views for query performance analysis Description Executes DBCC SHOW_STATISTICS to extract detailed information about statistics objects, including distribution histograms, density vectors, and header information. This helps DBAs diagnose query performance issues when the optimizer makes poor execution plan choices due to outdated or skewed statistics. You can analyze specific statistics objects or scan all statistics across databases to identify when UPDATE STATISTICS should be run.

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