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
Gouache painting of a basket with a heap of clothes beside neat folded stacks, a vermilion shirt on top

Heap or Clustered Index: When a Heap Table Is the Right Choice

June 7, 2023
Pinal Dave
SQL Performance
Clustered Index, SQL Data Storage, SQL Heap, SQL Index

The heap or clustered index choice changes the reads of every scan. The demos measure forwarded records in a heap, a range query on both kinds of table, and the size of a nonclustered index on a wide key, and says when a heap is the right choice.

Read More
Detachable collars with a single chosen stud fitted to each collar

One Default Row per Customer With a Filtered Unique Index

February 1, 2022
Pinal Dave
SQL Performance
Clustered Index, ColumnStore Index, SQL Index

Two browser tabs, two default addresses. Here is how a filtered unique index keeps the rule in the database and how to switch defaults safely.

Read More
Matching workpieces are compared around a new fitted guide and its maintenance tools.

SQL SERVER – Measure Index Performance

October 27, 2021
Pinal Dave
SQL Performance
Clustered Index, SQL Index, SQL Server, SQL Statistics

I measure index performance against the same workload before and after a change. A customer wanted to assess a new index.

Read More
Gouache painting of three bicycle wheels of different sizes on a rack, the smallest vermilion

Count Rows in a Heap: Which Scan Does SQL Server Use?

June 18, 2021
Pinal Dave
SQL Tips and Tricks
Clustered Index, Execution Plan, SQL Heap, SQL Index

Count rows in a heap and SQL Server scans every page. See the plan change with a clustered and a narrow index, and why a heap does not compact its pages.

Read More
Gouache painting of three vases in a row, the slimmest holding vermilion tulips

Index Used for COUNT(*): SQL Server Scans the Narrowest One

June 15, 2021
Pinal Dave
SQL Performance
Clustered Index, Execution Plan, SQL Index, SQL Scripts

The index used for COUNT(*) is the narrowest one that holds every row. See the pages, the scans and the reads that prove it in SQL Server.

Read More
Gouache painting of a wooden sieve beside a grey pail on a beach, with a heap of shells and one vermilion shell in the sieve

Number of Rows Read in an Execution Plan: What It Tells You

December 25, 2020
Pinal Dave
SQL Performance
Clustered Index, Execution Plan, SQL Index, SQL Server Management Studio

The number of rows read shows how many rows a scan or seek touched, and it can be far larger than the rows it returned. This post builds a demo table, compares a scan with two seeks, and explains why a seek can still read too many rows.

Read More
Gouache painting: a long wooden shelf of identical round teapots, each with a plain linen string tied around its handle so they can be told apart, the first teapot left bare and one string dyed vermilion

Uniquifier: The Hidden Cost of Duplicate Clustered Keys

November 2, 2020
Pinal Dave
SQL Performance
Clustered Index, SQL Data Storage, SQL DMV, SQL Index

The uniquifier is a hidden 4-byte value that SQL Server adds to duplicate keys in a non-unique clustered index. This post measures its real cost row by row on SQL Server 2025 and shows it on the page. It also compares it with a unique key you choose yourself.

Read More
Previous 1 2 3 4 5 … 8 Next
  • Books
  • Testimonials
  • Privacy Policy

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