-1

Can anyone direct me to an easy to understand explanation (that doesn't require me to read a 300-page tome) about how to index things and how to identify what to index, what it means to normalize things, etc? Or provide very simple examples?

1
  • If you think 300 pages is a tome, then you are lost. I wrote a book on that topic and I think it is as short as it can be to understand indexing. Still it has about 200 pages. You can read it for free at use-the-index-luke.com Mar 7, 2014 at 8:22

2 Answers 2

1

This is strictly for SQL Server

  1. for every "serious" data table, there must be a well-chosen clustering index. A good clustering index is narrow, unique, static (never changes) and ideally ever-increasing - an INT IDENTITY is as close to perfect as it can be

  2. For any column that is a foreign key, create a nonclustered index. This helps JOINs and other operations and is a generally accepted best practice

  3. Don't OVER-INDEX! - too many indices can be worse than none!

  4. Let your system run for a while, observe how it performs, identify potential performance bottlenecks

  5. if you have identified some performance issues, generate a representative workload (not just a single query; by using server-side tracing) and try to optimize that by using e.g. the Data Tuning Advisor (but don't blindly adopt everything the DTA says!)

  6. Implement one index at a time - observe your system again - did the performance (real or perceived) improve? If so: leave the index - if not: remove it again

Which indexes exactly to use - that's a bit of a black art based on a lot of know-how, experimentation, experience - you really can't give clear, black-or-white kind of ideas here. Try something - observe its benefit (or negative impact) - learn from it. Repeat until your retirement :-)

There's really no 10-page checklist and once you know that, you're done. Either you learn these things yourself, over the years - or you hire someone who has that expertise - your choice. There's no "easy way" to mastering everything about indexing in 5 easy lessons.....

2
  • The problem I have is that I have no idea how to even begin learning any of this. I am not sure what kind of data I should "experiment" with, what to practice with, etc. Mar 5, 2014 at 18:20
  • @user3219632: well - do you currently have a system with performance issues? It's always best to learn on a real, practical example. Otherwise: read, read, read! Lots of good blogs out there - or if you can, attend a course on SQL performance tuning techniques to learn the basics
    – marc_s
    Mar 5, 2014 at 19:17
0

Paul Litwin's Fundamentals of Relational Database Design is worth a read if you're starting from scratch. (22 page tome...) http://sbuweb.tcu.edu/bjones/20263/Access/AC101_FundamentalsDB_Design.pdf

And as he says, database design is more art than science, so examples will only get you so far with improving your own system(s).

Not the answer you're looking for? Browse other questions tagged or ask your own question.