Most database problems go unnoticed during development, because we tend to code our applications using small datasets. It is when the application has been on production for some time that database performance issues start to appear, causing parts of the application to become slower and slower as the database continues to grow.
How do you debug and identify this type of problems? In this article I'm going to show you how to fix the most common database performance problems, which are those that are caused by improper indexing. Examples for Postgres, MySQL and SQLite are included!
Source: Optimizing Slow SQL Queries, an article by Miguel Grinberg.