« SSWUG Virtual Conference - VIP Discount Code | Main | SQL Server Certification: Progress Report »

SQL Server Indexes: Tibor Karaszi's sp_indexinfo

My virtual colleague and friend (long time between conference beers!), SQL Server MCT and MVP Tibor Karaszi has updated his excellent stored procedure, sp_indexinfo, which returns detailed information on SQL Server indexes.

His description, in part:

I can't count how many times I wanted to know "more" about physical attributes for a table, including index information. So I end up running sp_helpindex, some SELECT over sys.indexes, some reports in SSMS, some other queries against other catalog and dynamic management views, etc. I wrote this procedure for those cases. Here's my version of a procedure to give me information like:

  • What indexes exists for a particular table or for each table in the database
  • Clustered, non-clustered or heap
  • Columns in the index
  • Included columns in the index
  • Unique or nonunique
  • Number rows in the table
  • Space usage
  • How frequently the indexes has been used
  • Any obvious indexes I should add?

For this, I use a number of sources, like sys.indexes, sys.columns, sys.partitions, sys.allocation_units, sys.data_spaces, sys.dm_db_index_usage_stats etc.

Go get the script here. And while you're on his site, check out his terrific explanation of the datetime data type.

Posted on Wednesday, February 18, 2009 at 12:11PM by Registered CommenterChris Randall | Comments1 Comment

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (1)

Way too long, Chris. :-)
March 5, 2009 | Unregistered CommenterTibor Karaszi

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.