Recently during the on-demand consultation, I was asked a very interesting question about Stream Aggregate and Hash Aggregate.
DISABLE_PARAMETER_SNIFFING Hint: Turn Off Sniffing for One Query
The DISABLE_PARAMETER_SNIFFING hint makes one query ignore the parameter value it was first compiled for. This post compares it with the default, OPTIMIZE FOR UNKNOWN and RECOMPILE on a table where one customer owns 40 percent of the rows. The reads show which variant fits which workload.
OPTION FAST N: First Rows Sooner, Total Reads Higher
OPTION FAST N tells SQL Server to plan for the first N rows, so the first rows arrive in milliseconds and the whole result costs much more. This post measures both sides on 300,000 rows with logical reads and time to the first row. It also explains why the hint belongs to paging and not to tuning.
DISABLE_OPTIMIZER_ROWGOAL: How a Row Goal Changes the Plan
DISABLE_OPTIMIZER_ROWGOAL switches off a row goal, the optimizer’s bet that a query needs only a few rows, and TOP, FAST, IN and EXISTS all place that bet. This post reads the estimates behind it, shows how the plan shape changes, and shows when the bet fails. A covering index fixes the failure, and the hint does not.
Parameter Sniffing Fixes Compared: Which One to Use
Parameter sniffing fixes compared on one table show a clear order, from a cheap guess to a better index. This post runs the plain procedure, a local variable, OPTIMIZE FOR UNKNOWN, a scoped setting, OPTION (RECOMPILE) and a covering index on the same skewed table, and prints the page reads of each in both call orders.
OPTION (RECOMPILE) Hint: When a Fresh Plan Pays Off
The OPTION (RECOMPILE) hint tells SQL Server to build a new plan every time a statement runs. This post measures the page reads it saves on skewed data, the compile cost it adds, the filtered index it unlocks, and how to apply it to one statement of a procedure.
ABORT_QUERY_EXECUTION: Stopping a Runaway Query With a Query Store Hint
ABORT_QUERY_EXECUTION is a SQL Server 2025 Query Store hint that makes one known bad query fail before it uses any CPU. This post sets the hint, shows the exact error the caller gets, lists and clears the hint, and covers the traps: exact text, SET options and queries already running.







