Multiple aggregates in one query read a table once, where separate subqueries read it again and again. This post measures the logical reads of two subqueries against one SELECT, uses CASE inside SUM for different filters, and shows two cases where the rewrite gains nothing or loses to an index.
LPIM Memory Model: Check It With sys.dm_os_sys_info
The LPIM memory model tells you whether SQL Server runs with locked pages. This post reads it from sys.dm_os_sys_info in one query, confirms it with the process memory view and the error log, and explains what each value means.
SQL SERVER – Queries Waiting for Memory Grant – Performance Tuning
Queries Waiting for memory grants give me evidence to investigate. A customer CTO requested that evidence before approving more RAM.
SQL Puzzle – IN and IS NOT NULL – Strange Results
Today, let us see a very simple puzzle where we are getting strange results when using NOT IN and IS NULL in a T-SQL query.
User Statistics Report in SSMS: Who Is Connected
The User Statistics report in SSMS shows the users who are connected to a database. This post opens the report, answers the same question with a query over sys.dm_exec_sessions, and finds the one application that holds many sessions.
SSMS Command Line Options: Server, Database and Login
SSMS command line options open Management Studio already pointed at a server and a database. This post finds SSMS.exe, lists the switches that SSMS 22 documents in its own usage text, and shows how to turn them into a shortcut without saving a password.
How to Force Index on a SQL Server Query? – Interview Question of the Week #281
Question: How to Force Index on a SQL Server Query?
Answer: I personally do not like to force an index on any query. Let us learn together.







