Honestly, the first thing I did was add indexes. On device_id, user_id, and date_added.<p>I'm using Linode and I kept getting these I/O notifications...and the site would load extremely slow at times.<p>After looking at the log of my Rails app, I saw that some requests were taking &#62; 20 seconds. I determined that this was some kind of blocking at the database.<p>I connected to MySQL and ran something simple...<p>select count(*) from location;<p>It took a long time...I turned profiling on and saw that it was taking a really long time in "table lock".<p>I assumed (which probably wasn't a good idea) that it was going through and counting all the rows.<p>I didn't really know what to make of this..because I didn't think that getting the count would take so long.<p>I embarked on reading about partitioning, which may have been a solution for a problem that didn't actually exist (based on the feedback here). I attempted to partition (on what I put in the article), and everything seemed much snappier after that. If the indexes should have solved the problem (given that they were correct), I don't know why the location queries were taking so long.<p>Anyway, I still have lots to learn on the database front, and maybe the fact that my VM had 7MB free of memory was causing weird things to happen, I'm not sure.<p>Thanks for all the feedback and I have definitely learned a lot in this thread.<p>kogir:<p>I'm using MyISAM (which, in retrospect, seems stupid), so I don't even have foreign key constraints (InnoDB only, I believe).