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 a wooden loom with a cream weaving and a vermilion shuttle trailing red thread

OS Threads by Scheduler in SQL Server: Count Them per CPU

May 7, 2021
Pinal Dave
SQL Performance
SQL CPU, SQL DMV, SQL Scripts, SQL Server

OS threads by scheduler shows how many Windows threads each SQL Server scheduler owns. This post joins the scheduler, worker and thread views and counts them per CPU. It compares the counts with the server totals and explains the hidden schedulers that a careless query counts as CPUs.

Read More
A grain sampling spear holding a small sample beside a full grain sack

rows_sampled: Checking How Much Data Your Statistics Saw

April 23, 2021
Pinal Dave
SQL Performance
Data Warehousing, Master Data Services, SQL Data Storage, SQL Statistics

A fresh statistic can still come from a small sample. Compare rows with rows_sampled and see how a sample misjudges a rare value.

Read More
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
A wide tractor at a narrow field gateway, turning along the hedge to take the long way round the field.

JDBC and sendStringParametersAsUnicode: The Hidden Index Scan

April 12, 2021
Pinal Dave
SQL Performance
Java, SQL Datatype, SQL Index, SQL Server, Unicode

Diagnose sendStringParametersAsUnicode conversions, align JDBC parameters with varchar indexes, and preserve required Unicode data.

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 hand muffling the clapper of one handbell with a leather pad in a row of brass handbells

USE HINT: Switching Off One Optimizer Rule Without Trace Flags

April 5, 2021
Pinal Dave
SQL Performance
Query Hint, Query Store, SQL Server, TraceFlags

Apply USE HINT to one query, inspect supported names, compare optimizer behavior, and manage Query Store hints with a clear removal plan.

Read More
Previous 1 … 14 15 16 17 18 19 20 … 127 Next
  • Books
  • Testimonials
  • Privacy Policy

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