Indexes

Tag: indexes

Altering an Indexed View in SQL Server Drops All Indexes

Altering an Indexed View in SQL Server Drops All Indexes

I learned an interesting thing about ALTER VIEW behavior in SQL Server when applied to indexed views. This is covered in the product documentation, but it’s not something I would have expected.

Continue reading

Should You Rebuild or Reorganize Indexes on Large Tables? (Dear SQL DBA Episode 19)

Should You Rebuild or Reorganize Indexes on Large Tables? (Dear SQL DBA Episode 19)

The bigger your indexes are, the harder your index maintenance falls. Is it better to rebuild big indexes? Or should you reorganize?

Continue reading

Can I Use Statistics to Design Indexes? (Dear SQL DBA Episode 18)

Can I Use Statistics to Design Indexes? (Dear SQL DBA Episode 18)

By Kendra Little on October 6, 2016

Should you look at automatically created statistics on  your tables in SQL Server to help you design better indexes? Learn why in this 20 minute video, or subscribe to the Dear SQL DBA podcast.

No time to watch? Scroll on down, everything is written in article form below the video.

Here’s this week’s question:

Continue reading

Which is Worse: an Unused Index, or an Un-Indexed Foreign Key? (Dear SQL DBA Episode 16)

Which is Worse: an Unused Index, or an Un-Indexed Foreign Key? (Dear SQL DBA Episode 16)

Should you always index your foreign keys? What if you index them, and then the index never gets used?

Continue reading

Index Usage Stats Insanity - the oddities of sys.dm db index usage stats (Dear SQL DBA)

Index Usage Stats Insanity - the oddities of sys.dm db index usage stats (Dear SQL DBA)

SQL Server’s “index usage stats” dynamic management view is incredibly useful– but does it tell you what you THINK it tells you?

I explain the quirks of how sys.dm_db_index_usage_stats works and why the information is so valuable.

Continue reading

Index Usage Stats Bug Fixed in SQL Server 2012 SP2 CU12 / SP3 CU3

Index Usage Stats Bug Fixed in SQL Server 2012 SP2 CU12 / SP3 CU3

Microsoft has just released a new round of cumulative updates for SQL Server 2012, and the release notes indicate that a fix to the sys.dm_db_index_usage_stats dynamic management view has been included in these updates. This is good news for index tuners using SQL Server 2012.

As of SP2 + CU12 and SP3 + CU3, SQL Server 2012 will persist index usage information even when ALTER INDEX REBUILD is run.

Continue reading

Indexes: Do Included Columns Always Go on a Non-Root Page? (video)

Indexes: Do Included Columns Always Go on a Non-Root Page? (video)

Recently, I was thinking about nonclustered indexes in SQL Server, and how included columns are stored.

Is SQL Server smart enough to optimize the storage for small indexes with includes? Find out in this free seven minute video.

Continue reading