Index Design and Access Paths

Clustered and nonclustered indexes, keys, included columns, and access paths.

113 associated posts109 primary posts

Performance Tuning

Trivial Optimization and Missing Indexes in SQL Server

Recently, Jes asked the team an index tuning question: "If a query has an index hint in it, will the optimizer ever suggest a missing index for that query?"

I immediately loved the question because I'd never really thought about it before. I typically think of index hints as being a very risky game and avoid them whenever I can-- after all if someone drops the index you've hinted, any query hinting a non-existent index will start to fail. (That's a really bad day!)

Read more about Trivial Optimization and Missing Indexes in SQL Server 7 comments — Join the discussion
Performance Tuning

How to Find ‘Secret Columns’ in Nonclustered Indexes

sp_BlitzIndex® just can't keep a secret. That's a feature, not a bug. I wrote sp_BlitzIndex® specifically so that it would rat out some things that SQL Server is doing behind the scenes to secretly help you out-- because it's really better if you know about it. What are secret columns? SQL Server needs a unique…

Read more about How to Find ‘Secret Columns’ in Nonclustered Indexes 21 comments — Join the discussion
Performance Tuning

The Index Your Queries will Never Request (A Clustered Index!)

When it comes to indexes, SQL Server is really helpful. It lets you see what indexes queries are asking for both in execution plans, and missing index dynamic management views ("DMVs"). I like to look at the DMV missing index requests using sp_BlitzIndex®.

When you look at missing index requests, it's always important to remember one of the biggest things: these missing index requests won't ever ask for or recommend a specific clustered index.

Read more about The Index Your Queries will Never Request (A Clustered Index!) 3 comments — Join the discussion
Production DBA

The Trouble with Keys

Scaling up is hard: big hardware gets expensive fast. Scaling out is equally difficult; interesting design problems creep in to scale out solutions. One of the more troublesome issues architects face when scaling out is the issue of distributing identity. It's often advantageous for object identity to be unique and portable across all database instances…

Read more about The Trouble with Keys 22 comments — Join the discussion
Performance Tuning

Kendra Little Explains How to Design Smarter Indexes

How do you know which indexes to create to improve your database performance? Microsoft Certified Master Kendra Little shows you how to find a missing index, decide on the best index definition, and measure the usefulness of your new index. If you know the basics of what a database index does and want to learn the smart way to design indexes, this talk is for you.

Read more about Kendra Little Explains How to Design Smarter Indexes 23 comments — Join the discussion
Performance Tuning

SQL Server training for developers: primary keys & indexes

I had to do some developer training last week and I wrote up a paper on the basics of primary keys and indexes. Sure, there's tons of similar stuff around the net, but this is MINE, baby.
Our Table: Phone Numbers
For our evil training purposes, let's say we work for the phone company, and we need a database table with phone numbers. We need to track:

Read more about SQL Server training for developers: primary keys & indexes 8 comments — Join the discussion