Which MDF or NDF file is the busiest? This query uses fn_virtualfilestats to show reads, writes, IO stalls and size for every database file.
SQL SERVER – DMV – sys.dm_exec_query_optimizer_info – Statistics of Optimizer
The DMV sys.dm_exec_query_optimizer_info keeps statistics of optimizer activity. My simple query shows optimizations, elapsed time, final cost and more.
Striped Backups: Writing One Backup to Several Files
Use striped backups across several files, inspect media families, restore every stripe, and test resource settings on your own server.
SQL SERVER – Copy Statistics from One Server to Another Server
Without the client’s data, every query ran in zero milliseconds. Here is how I copy statistics from one server to another to tune with only the schema.
Unused Index Script: Find Indexes That Only Cost You Writes
This Unused Index Script lists nonclustered indexes that SQL Server keeps writing to and no query ever reads. It starts from the index list so untouched indexes are not missed, skips the risky ones, and writes the disable and recreate statements. A garden center orders table shows one update dropping from 5,011 pages to 6 once an unused index is disabled.
Missing Index Script: Read the Suggestions Before You Create
This Missing Index Script ranks the indexes SQL Server wishes it had by a plain score and builds a CREATE INDEX statement for each. Read the key order, the INCLUDE list and the overlap before you create one. A garden center orders table shows the logical reads drop from 3,138 pages to 3.
SQL SERVER – Reduce the Virtual Log Files (VLFs) from LDF file
Too many virtual log files are bad for your LDF. Here is a simple script to reduce the virtual log files right away with a log backup and a shrink.







