Comment 3 for bug 827935

Revision history for this message
Raphaƫl Badin (rvb) wrote :

Most of the time is indeed spent computing counts; Unfortunately I think Abel's work on StormRangeFactory cannot be applied to this because of the limitations it has (namely, that resultsets must be entire objects: simply adding range_factory = StormRangeFactory(results) fails to create a proper explain query: "EXPLAIN SELECT Branch.date_last_modified DESC, Branch.target [...]"). Maybe the query could be refactored to make it work but the way the query is built is rather complex.

I'll see if I can find a way to improve the queries themselves (for instance by caching the result of the subquery https://pastebin.canonical.com/54940/ which is repeated over and over).