Indexing

  1. Home
  2. Indexing
  3. (Page 6)

Rebuilding Indexes Can Slow Queries Down

Index Maintenance
6 Comments
Today, Jonathan Kehayias wrote about how fragmentation impacts execution plans. I’m really into performance tuning, so I read the post carefully, really interested to see how it impacted query runtime. You should read it too – it’s a great post with a solid demo. But oddly, he didn’t mention the query speeds. I thought that was…
Read More
Brent Ozar reading

New System Stored Procedures in SQL Server 2017

Columnstore Indexes, SQL Server 2017
0
Got a few new stored procs for columnstore indexes: sp_add_columnstore_column_dictionary – input params for @table_id, @column_id sp_is_columnstore_column_dictionary_enabled – as above, plus output param for @is_enabled bit sp_remove_columnstore_column_dictionary – input params for @table_id, @column_id And a couple for snapshot views (which appear to be related to the new snapshot messages in sys.messages) sp_refresh_single_snapshot_view – input param for @view_name…
Read More

Why Columnstore Indexes May Still Do Key Lookups

I was a bit surprised that key lookups were a possibility with ColumnStore indexes, since “keys” aren’t really their strong point, but since we’re now able to have both clustered ColumnStore indexes alongside row store nonclustered indexes AND nonclustered ColumnStore indexes on tables with row store clustered indexes, this kind of stuff should get a…
Read More

ColumnStore Indexes: Rowgroup Elimination and Parameter Sniffing In Stored Procedures

Yazoo Over on his blog, fellow Query Plan aficionado Joe Obbish has a Great Post, Brent® about query patterns that qualify for Rowgroup Elimination. This is really important to performance! It allows scans to skip over stuff it doesn’t need, like skipping over the dialog in, uh… movies with really good fight scenes. Car chases?…
Read More

How to Drop All Your Indexes – Fast

Sometimes I need to reset stuff during performance training classes. I know some of you teach classes, too, and some of you just like doing crazy stuff. So here you go, a stored procedure to lose weight fast: DropIndexes for SQL Server 2016 & Newer Transact-SQL CREATE OR ALTER PROCEDURE dbo.DropIndexes @SchemaName NVARCHAR(255) = 'dbo',…
Read More

Why Missing Index Recommendations Aren’t Perfect

Indexing
6 Comments
Using the good ol’ Stack Overflow public database, get the execution plan for this query – either estimated or actual, doesn’t matter: Transact-SQL SELECT Id FROM dbo.Users WHERE LastAccessDate = '2016/11/10'; 123 SELECT IdFROM dbo.UsersWHERE LastAccessDate = '2016/11/10'; In the execution plan, SQL Server asks for a missing index on the LastAccessDate field: Missing index…
Read More

Will SQL Server Always Do Index Seeks on Numbers?

Indexing
3 Comments
I often get the question of “Will SQL Server do an index seek with ____?” Another way to phrase it is, “Is this query sargable?” We throw the term “sargable” around to mean that SQL Server can do an index seek to satisfy your search arguments. (We’re specifically talking about index seeks here, not scans – not…
Read More
Menu