This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Gouache painting of four sailboats moored beside a calm dock with posts topped by small vermilion lights

OS Thread of a Session: Map Session ID to Windows Thread ID

April 14, 2021
Pinal Dave
SQL Performance
SQL CPU, SQL DMV, SQL Scripts, SQL Server

To find the OS thread of a session, join sys.dm_os_tasks to sys.dm_os_threads on the worker address. This post reads the map for your own session and for every user session. It explains why idle sessions have no row, why parallel queries have several, and how to follow a thread in Performance Monitor.

Read More
Gouache painting of a row of six clay cups on a windowsill in blue, pink, cream, sage and vermilion

sys.dm_exec_valid_use_hints: Every USE HINT Your Server Knows

April 13, 2021
Pinal Dave
SQL Performance
Parameter Sniffing, Query Hint, SQL DMV, SQL Scripts

sys.dm_exec_valid_use_hints lists every USE HINT name that your SQL Server accepts. This post groups the 35 names on SQL Server 2025 and shows the compile error for a misspelled hint. It applies two hints and reads the plan to prove each one worked, then compares USE HINT with QUERYTRACEON.

Read More
Gouache painting: a row of eight windmills along a ridge at dusk, most sails turning and three standing still, one windmill with a vermilion sail

Threads With Zero Rows in a Parallel Plan, Measured

April 7, 2021
Pinal Dave
SQL Performance
Execution Plan, MAXDOP, Parallel, SQL DMV, SQL Scripts

A parallel plan can show threads with zero rows, and that is normal. This post reads the per-thread row counters of two real plans on SQL Server 2025 and shows where the empty threads come from. It also says when an empty thread points to a real problem.

Read More
A farmhouse fireplace just relit in the morning, a small flame catching on kindling under cold logs.

When Did SQL Server Last Restart? Four Ways to Check

April 2, 2021
Pinal Dave
SQL Tips and Tricks
DBA, SQL DMV, SQL Log, SQL Server, SQL TempDB

Find SQL Server’s last restart using startup metadata, tempdb, logs, and sessions, then interpret reset counters correctly.

Read More
Gouache painting of a kitchen counter crowded with bowls around one large vermilion bowl of tomatoes

Cached Data Per Object in Memory: Read the Buffer Pool

March 31, 2021
Pinal Dave
SQL Performance
SQL DMV, SQL Memory, SQL Scripts, SQL Server

Cached data per object tells you which tables and indexes fill the buffer pool. This post builds two demo tables, empties their cache and reads part of the data. A query then lists the pages, megabytes and share of each index in memory. It also explains why the view is costly on a big server.

Read More
Gouache painting of a balance with a bowl of many small cherries on one pan and one giant orange pumpkin on the other

Which Tables Are Huge: Rows Versus Size in SQL Server

February 12, 2021
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Scripts, SQL Server

Rows versus size decides which tables are huge in SQL Server. One query reads sys.dm_db_partition_stats and ranks every table twice, by rows and by size. A demo shows 300 rows that outweigh 300,000 rows, and why the older join misleads.

Read More
Birds spaced along a power line except around one red insulator where dozens crowd together

Finding the Indexes Behind Lock Waits With Operational Stats

January 18, 2021
Pinal Dave
SQL Performance
SQL DMV, SQL Index, SQL Lock, SQL Wait Stats

Rank indexes behind lock waits with operational stats, separate latches from locks, and test targeted access or row versioning fixes.

Read More
Previous 1 2 3 4 5 6 7 8 … 44 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com