This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Illustrated cover: SUM(1)

SQL Server – Single Scan for 3 Operations – COUNT(*) COUNT(1) SUM(1)

June 30, 2021
Pinal Dave
SQL Performance
Execution Plan, SQL Function, SQL Index, SQL Scripts, SQL Server, SQL Server Management Studio

Today we will take the same conversation to the next level by discussing Single Scan for 3 Operations – COUNT(*) COUNT(1) SUM(1).

Read More
sum

SUM(1) vs COUNT(1) Performance Battle – SQL in Sixty Seconds #177

June 29, 2021
Pinal Dave
SQL Video
Execution Plan, SQL Function, SQL in Sixty Seconds, SQL Scripts, SQL Server

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.

Read More
A row of iron cleats on a dock, all lines slack except one taut red line.

Latch Waits at the Top: Reading sys.dm_os_latch_stats

June 28, 2021
Pinal Dave
SQL Performance
DBA, SQL DMV, SQL Performance, SQL Wait Stats

Sample SQL Server latch waits by class, then connect ACCESS_METHODS_DATASET_PARENT, FGCB_ADD_REMOVE, and LOG_MANAGER to the next check.

Read More
Three tools inspect one populated source while a separate empty tray remains visible.

SQL SERVER – SUM(1) vs COUNT(*) – Performance Observation

June 25, 2021
Pinal Dave
SQL Performance
Execution Plan, SQL Scripts, SQL Server

My Performance Observation found similar counting plans for a nonempty table. SUM(1) and COUNT(*) still differ on empty input.

Read More
A gardener walking a row of berry bushes with three small baskets on one strap, sorting berries in a single pass.

Conditional Aggregation: Several Counts in One Pass With CASE

June 24, 2021
Pinal Dave
SQL Tips and Tricks
PIVOT and UNPIVOT, SQL CASE, SQL Group By, SQL Scripts, SQL Server

Use conditional aggregation for several ticket counts, avoid COUNT with ELSE zero, and calculate percentages with an explicit denominator.

Read More
Battle

COUNT(*) and COUNT(1): Performance Battle – SQL in Sixty Seconds #176

June 23, 2021
Pinal Dave
SQL Video
Execution Plan, SQL in Sixty Seconds, SQL Scripts, SQL Server

COUNT(*) and COUNT(1): Performance Battle – which one is better for performance? I got this question after watching my previous video.

Read More
Different inspection guides examine one complete tray beside a populated-value sample dish.

COUNT(*) and Index Frequently Asked Questions

June 22, 2021
Pinal Dave
SQL Tips and Tricks
SQL Index, SQL Scripts, SQL Server

My Index Frequently Asked Questions discussion follows the counting video. I distinguish exact results, estimates and the expression being counted.

Read More
Previous 1 … 61 62 63 64 65 66 67 … 843 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com