Wednesday, April 1, 2009

MySQL to PostgreSQL

Last week, we started noticing Jawaker becoming a bit slow. To investigate the problem, we built some custom tools and analyzed the logs. It turned out the game index is taking way too long to render! Digging a bit deeper, it turned out to be a particular SQL query.

We had earlier optimized most of our SQL queries, but we nevertheless tried our best to optimize this one even more. It wasn't clear why this query would take so much time; a very unreasonable amount of time actually. Fouad, being bitten by MySQL many times before, figured out that we might be better off if we try another system, in particular, PostgreSQL.

It took us one restless day to acquaint ourselves with Postgres, adjust the old queries for compatibility, create new schema, and move all the data. But it was worth it

At the end of the day, the problematic page was loading about 80 times faster! The server load dropped by a factor of more than 10.

No comments:

Post a Comment