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.
SQL Server emergency? Email pinal@sqlauthority.com with URGENT in the subject line.
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.
What is the Priority of Database Scoped Configurations? – Interview Question of the Week #254
Question: What is the Priority of Database Scoped Configurations over Global Configuration at Server Level?
Answer: This is a follow-up question.
SQL Server slow? Let's fix it together in about four hours.
In my Comprehensive Database Performance Health Check, you share your screen, I guide you, and we fix your biggest performance troublemakers. No passwords. No remote access.
You keep every script, and the know-how to fix it yourself next time.
Want your whole team to learn it?
My Practical Workshop has no PowerPoint, just live demos. My AI Enablement Workshop shows your team where AI saves hours, and where it quietly costs them.
Over 400 customers have worked with me this way, and not one shared a password. See all consulting options.
Who We Are
Pinal Dave is an SQL Server Performance Tuning Expert and independent consultant with over 24 years of hands-on experience. He holds a Masters of Science degree and numerous database certifications.
Pinal has authored 19 books and 125 Pluralsight courses. To freely share his knowledge and help others build their expertise, Pinal has also written more than 5,800 database tech articles on his blog at https://blog.sqlauthority.com.
Pinal is also a CrossFit Level 1 Trainer (CF-L1) and CrossFit Level 2 Trainer (CF-L2).
Nupur Dave is a social media enthusiast and an independent consultant. She primarily focuses on the database domain, helping clients build short and long-term multi-channel campaigns to drive leads for their sales pipeline.
Shaivi Pinalkumar Dave is a book author and a women’s artistic gymnast.

