Indexing isn't hard
I found this blog post via Reddit and was happy to see the positive benefits the author is getting from profiling his SQL and indexing his database. He could have avoided the slow running query in the first place by following Andy's simple rules of indexing;
- If your database doesn't do it automatically, add indexes to all of your primary key columns
- Add indexes to all of your natural key columns
- Add indexes to all of your foreign key columns