Not all stats should be auto-updated

August 29, 2024 Andy 1

Statistics auto-updates are generally a good thing–auto-update of statistics is the default behavior in SQL Server. Having the freshest information about the data “shape” helps to inform the best selection of an execution plan for queries. Except for when it doesn’t. Because It Depends™️ Let’s … [Read More]

When to put a non-clustered index on your clustering key

September 3, 2019 Andy 1

There is a corner case where it makes sense to have a non-clustered index “duplicating” the clustered index. If you have a query that frequently scans the table, and ONLY makes use of the clustering key column, the query optimizer will prefer to use the non-clustered index.

Data Compression: How page compression works

February 22, 2016 Andy 1

SQL Server supports two kinds of data compression on rowstore data. Columnstore compression is for a different day. You can compress heaps, clustered indexes (on both tables and views), and nonclustered indexes (on both tables and views). Compression requirements Data compression is available in SQL … [Read More]

No Picture

Data Compression: How row compression works

February 15, 2016 Andy 3

SQL Server supports two kinds of data compression on rowstore data. Columnstore compression is for a different day. You can compress heaps, clustered indexes (on both tables and views), and nonclustered indexes (on both tables and views). Compression requirements Data compression is available in SQL … [Read More]

No Picture

Data Compression: Costs & benefits

December 29, 2015 Andy 3

SQL Server supports two kinds of data compression on rowstore data. Columnstore compression is for a different day. You can compress heaps, clustered indexes (on both tables and views), and nonclustered indexes (on both tables and views). Compression requirements Data compression is available in SQL … [Read More]

sp_get_basetable_list

May 22, 2014 Andy 0

At work, we make extensive use of views & synonyms. The reasons are complex (and fodder for another post), but here’s a simplified example: Pricing data is updated multiple times per day, and we want to keep multiple generations of the pricing table online. By … [Read More]