tobami/codespeed — pull request #98 by squiddy (2011-12-10 17:13:57+00:00)
Title: Query optimization

First part of a couple of improvements to the queries. I worked on two functions (`getbaselineexecutables` and `getcomparisondata`).

#### Quick summary (commit messages offer a bit more detail)

`getbaselineexecutables`
Got the query count from **1+3*N** down to **2** (N - count of tagged revisions). I tested this against speed.pypy.org data, runtime of the function went down from 17ms to 4ms.
Not that much of an improvement, but maybe there are use-cases with a lot of tagged revisions, where query count increases a lot. Having at most 2 queries under any situation isn't bad I think.

`getcomparisondata`
Much, much more interesting. Again with PyPy data, query count went down from **1893** to **75**. When running on SQLite running time of this function was **2.8 seconds**. With this change, it's down to **100ms**. And that's noticable.