Wikia/liftium — pull request #3 by gorillamania (2013-03-28 00:22:07+00:00)
Title: Config performance

Ops had noticed that there were a lot of sql statements when the config was being generated. This was because we were doing a sql statement for each tag to get its daily count from the fills_minute table, for the pacing functionality.

I implemented a caching function that batched these sql statements together, making it do 2 per request instead of one *per tag*.

To verify, I had mysql running with an empty cache, and did requests with the old and new code, and there are 109 less sql statements in the new version. I verified that the end result is the same.