Counting rows forces full scans.
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
Counting rows forces full scans.
SELECT COUNT_BIG(*) FROM Orders WITH (NOLOCK);
Why this matters
On massive tables, counts are expensive — cache or approximate when possible.