Comment 7 for bug 328302

Revision history for this message
Stuart Bishop (stub) wrote : Re: [Bug 328302] Re: code.lp.net/launchpad timing out frequently

On Tue, Mar 3, 2009 at 12:37 AM, Jonathan Lange <email address hidden> wrote:
> stub and I talked a bit about this on IRC. The server where my logs are
> is unavailable at the moment.
>
> stub, can you tell us what to do? :)

There is an optimization on the existing query, restricting the set of
BranchRevisions that need to be joined through. This optimization no
longer works as we have Revisions from the future.

We can get the existing optimization working and back to where we
where by doing:

UPDATE Revision SET revision_date=date_created WHERE revision_date >
date_created;

(and fixing the code to make revisions with future dates saner).

If we don't do this, we have to add revision_date to BranchRevision,
mirroring the Revision.revision_date.

We also discussed not doing these queries in real time to generate the
statistics, but have the calculations cached. The cache would be
updated by the branchscanner.

--
Stuart Bishop <email address hidden>
http://www.stuartbishop.net/