In my infancy as a web developer, I was often caught out by a lot of really simple problems. One of these really simple problems was slow SELECT queries on a MySQL database when using “JOIN” or “WHERE”. I was quite often baffled; the site seemed really quick when I first launched it, and I hadn’t made any code changes, so what could have changed that made the “News Listing” page so slow? The answer was staring me in the face, but it still took me a bit of time to find it. The problem? The database table had a higher number of records in it, and when JOINING or searching, the application was forcing MySQL to do what are called “full table scans”. Once I discovered this was the problem, I was amazed at the difference in performance something so simple could result in. (more…)