A query plan join can appear even when the query has no join, because SQL Server joins a nonclustered index to the table itself. This post reads the plan of a one table query, removes the join with a covering index, and finds the row count where SQL Server stops using lookups.
Statistics Sample Percent and PERSIST_SAMPLE_PERCENT
The statistics sample percent decides how many rows SQL Server reads when it updates a statistic. A tested demo on 1,000,000 rows shows the default sample of 35.5 percent, a FULLSCAN of 100 percent, and the way PERSIST_SAMPLE_PERCENT keeps 100 percent for later updates, including an automatic one. It also shows that a sampled update can be slower than a full scan.
Nullable Columns in a Database: List Them and Count NULLs
Nullable columns in a database cost you ISNULL calls and OR IS NULL conditions in every query. This post lists them with a catalog query, compares the INFORMATION_SCHEMA version, and counts the real NULLs in each column. The count tells you which columns can become NOT NULL and which can go.
APPROX_COUNT_DISTINCT With GROUP BY: When Exact Wins
APPROX_COUNT_DISTINCT with GROUP BY returns an estimate for every group. A tested demo on 2,000,000 rows shows a memory grant of 207,616 KB for the exact count against 3,112 KB for the estimate, and a memory grant of 0 for the exact count once an index exists. It also shows the error on small groups, where 4,648 of 100,000 groups were off.
Queries Waiting for Memory: Read the Grant Counters
Queries waiting for memory are counted by the Memory Grants Pending counter and listed by sys.dm_exec_query_memory_grants. A tested demo holds a sort grant of 41,848 KB with a blocked query and reads it from the view. The post explains how to spot a waiting request and what causes the wait.
Row Mode Memory Grant Feedback: It Needs Level 150
Row mode memory grant feedback needs compatibility level 150 or higher, while batch mode needs only 140. A tested demo runs a row mode sort and a batch mode sort at levels 140, 150 and 170. The row sort keeps its grant of 11,888 KB at level 140 and drops to 1,536 KB at 150.
Database Scoped Configuration Options in SQL Server
Database scoped configuration options change how one database behaves, without touching the server. This post lists all 41 options on SQL Server 2025, finds the 7 ids that are missing, and changes and restores two settings in a demo database. It also answers the old question about configuration id 5.







