distroseries+index oops getting the count of linked packages

Bug #615064 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Robert Collins

Bug Description

The recent fix to improve the speed of the packaging portlet exposes another poor performing query.

OOPS-1681EB2995 shows distroseries.getMostRecentlyLinkedPackagings() is asking for 5 tuples of (packaging, spn, product_series, product), but tis causes 238 TeamPartcipation and 207 Person queries. The problem starts when the distroseries gotten. Only one Packaging is retieved by the moment of the timeout.

Revision history for this message
Robert Collins (lifeless) wrote :

Looks like that might benefit from a generalisation of my Person._all_members work too - 50 or so of the repeated queries are all Person attributes.

description: updated
Curtis Hovey (sinzui)
Changed in launchpad-registry:
milestone: 10.08 → 10.09
Revision history for this message
Curtis Hovey (sinzui) wrote :

Edwin believe the query that dies is getting the count of linked packages in the series. We only want a number--no objects are needed.

summary: - distroseries+index oops getMostRecentlyLinkedPackagings
+ distroseries+index oops getting the count of linked packages
Revision history for this message
Curtis Hovey (sinzui) wrote :

This oops was caused calling len(distroseries.packackings) where packagings is a storm query that builds several objects (packaging, productseries, distroseries, product) because most cases where a packaging object wanted is to get the other objects.

But, and this is the insight into this issue: The callsite only wants the count, and this is the only callsite for distroseries.packagings. All the other callsites were recently updated to use specialised methods that wrap the newer _all_packagings cached property.

Remove distroseries.packagings
Add distroseries.packaging_count, it aly be as simple as:
    return len(self._all_packagings)

Curtis Hovey (sinzui)
Changed in launchpad-registry:
milestone: 10.09 → 10.08
status: Triaged → Fix Committed
assignee: nobody → Robert Collins (lifeless)
Revision history for this message
Curtis Hovey (sinzui) wrote : Bug 615064 Fix released

Fixed released in launchpad-project 10.08.

Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: Fix Committed → Fix Released
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.