Calling total or lastBatch on a batch will issue two COUNT queries

Bug #905439 reported by Deryck Hodge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lazr.batchnavigator
Invalid
High
Unassigned

Bug Description

This was discovered during the beta of the new custom bug listings feature work on Launchpad. If you have a batch and call total *and* lastBatch on it, i.e.:

total = batch_nav.batch.total()
last_batch = batch_navigator.batch.lastBatch()

then the batch navigator will issue two COUNT queries. For certain navigation lists, this extra count can be deadly. The code takes some precautions to cache listlength in a local variable, but for some reason, the sample code above forces a second query.

Deryck Hodge (deryck)
Changed in lazr.batchnavigator:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Abel Deuring (adeuring) wrote :
Changed in lazr.batchnavigator:
status: Triaged → Invalid
Revision history for this message
Deryck Hodge (deryck) wrote :

FWIW, I'm agreed there are not duplicate COUNTs.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.