Today we will take the same conversation to the next level by discussing Single Scan for 3 Operations – COUNT(*) COUNT(1) SUM(1).
SUM(1) vs COUNT(1) Performance Battle – SQL in Sixty Seconds #177
Based on my recent two videos, I got lots of questions about SUM(1) vs COUNT(1) Performance Battle. Let us see that in today’s video.
Latch Waits at the Top: Reading sys.dm_os_latch_stats
Sample SQL Server latch waits by class, then connect ACCESS_METHODS_DATASET_PARENT, FGCB_ADD_REMOVE, and LOG_MANAGER to the next check.
SQL SERVER – SUM(1) vs COUNT(*) – Performance Observation
My Performance Observation found similar counting plans for a nonempty table. SUM(1) and COUNT(*) still differ on empty input.
Conditional Aggregation: Several Counts in One Pass With CASE
Use conditional aggregation for several ticket counts, avoid COUNT with ELSE zero, and calculate percentages with an explicit denominator.
COUNT(*) and COUNT(1): Performance Battle – SQL in Sixty Seconds #176
COUNT(*) and COUNT(1): Performance Battle – which one is better for performance? I got this question after watching my previous video.
COUNT(*) and Index Frequently Asked Questions
My Index Frequently Asked Questions discussion follows the counting video. I distinguish exact results, estimates and the expression being counted.







