Calling total or lastBatch on a batch will issue two COUNT queries
Bug #905439 reported by
Deryck Hodge
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.
last_batch = batch_navigator
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.
Changed in lazr.batchnavigator: | |
status: | New → Triaged |
importance: | Undecided → High |
To post a comment you must log in.
As written in https:/ /code.launchpad .net/~deryck/ launchpad/ avoid-extra- buglist- count-901124/ +merge/ 85940/comments/ 186050 , I think there are no repeated COUNT queries.