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 wooden crate of oranges on a windowsill with one dark vermilion fruit among them

Fragmentation in Columnstore Indexes: Find and Fix It

January 7, 2021
Pinal Dave
SQL Performance
ColumnStore Index, SQL Index, SQL Scripts, SQL Server

Fragmentation in columnstore indexes means deleted rows that stay inside compressed row groups, and row groups that are too small. This post builds a demo table, measures the deleted rows with the row group view, and compares REORGANIZE with REBUILD.

Read More
Gouache painting of an empty tray beside a vermilion crate packed with nails on a shop counter

Locally Aggregated Rows: Why a Columnstore Scan Shows Zero

November 25, 2019
Pinal Dave
SQL Performance
ColumnStore Index, Execution Plan, SQL Scripts

A columnstore scan shows zero actual rows when it aggregates rows itself, and the rows sit in the locally aggregated rows property. A tested demo on 1,000,000 rows shows 0 actual rows and 1,000,000 locally aggregated rows. The post also covers a scan that really is empty, and what STATISTICS IO counts.

Read More
A multi-hole planting tool and a single-hole dibber offer two ways to process a row

How to Disable Batch Mode in SQL Server? – Interview Question of the Week #252

November 24, 2019
Pinal Dave
SQL Interview Questions and Answers
ColumnStore Index, SQL Index, SQL Performance, SQL Scripts, SQL Server

My immediate reaction was why would you disable batch mode in SQL Server when it is really is an awesome feature for performance

Read More
Gouache painting of two wheelbarrows by a pile of bricks, one with a single brick and one stacked full in vermilion

Row Mode vs Batch Mode: Measuring the Speed Difference

November 21, 2019
Pinal Dave
SQL Performance
ColumnStore Index, Compatibility Level, Execution Plan, SQL Scripts

A fair test of row mode vs batch mode changes only the execution mode. This post uses a query hint to force row mode at the same compatibility level, checks that both modes return the same rows, and times five runs of each on a three million row table. It also shows a query where batch mode gains nothing.

Read More
Gouache painting of a wheelbarrow with a full vermilion crate of apples and a single apple on a plate behind

Batch Mode on Rowstore: A Simple Example in SQL Server

November 18, 2019
Pinal Dave
SQL Performance
ColumnStore Index, Compatibility Level, Execution Plan, SQL Scripts

Batch mode on rowstore lets SQL Server process rows in groups, even when the table has no columnstore index. This post builds a million row table, reads the execution mode of each plan operator, and flips four switches to show when you get batch mode and when you don’t. It also answers why a plan can stay in row mode.

Read More
Gouache painting of a folding table in a park with tall slender jars of flowers, the last one vermilion

Nonclustered Columnstore Index on a Temp Table in SQL Server

October 31, 2019
Pinal Dave
SQL Tips and Tricks
ColumnStore Index, SQL Index, SQL Scripts, Temp Table

A nonclustered columnstore index works on a temp table but not on a table variable. This post loads a temp table, builds the index, and measures the same aggregate query before and after. It also shows the error a table variable raises and when the build cost pays off.

Read More
Gouache painting of tall narrow pantry jars of different lentils with one jar of vermilion lentils

Columnstore Indexes Without Aggregation: Do They Still Help?

September 30, 2019
Pinal Dave
SQL Performance
ColumnStore Index, SQL Index, SQL Scripts

Columnstore indexes without aggregation still help when a query reads many rows but only a few columns. This post builds a rowstore table and a columnstore copy of one million rows and compares reads, size and execution mode. It also shows the case where a plain b-tree index wins.

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

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