#2780 avoid needless package owner joins
Closed: Fixed 3 years ago by tkopecek. Opened 3 years ago by mikem.

The readPackageList call is a fairly complex call and is used frequently. We recently observed some performance issues with it that seemed to relate to the tag_package_owner table.

In many cases, we don't need the ownership data, so it would be more efficient to have an option to avoid the join. The main case for concern is the call to readTaggedRPMS in repo_init, but there could be others.

I suggest adding a with_owners option to readPackageList, which would default to True. If given as False, the query would skip joining the tag_package_owners and users tables.

In the places where we call this function and do not need ownership data, we would set the option to False. In particular, this would include:

  • readTaggedBuilds (which only considers the package ids)
  • maven_tag_archives (ditto)
  • repo_init (only considers package_name and blocked fields)

We might also consider adding the same option to the listPackages api call and passing it through. Some client calls might also benefit from this.


This might not be an exhaustive list, but it's a good start.

Metadata Update from @mikem:
- Custom field Size adjusted to None

3 years ago

Some client calls might also benefit from this.

In the add-pkg cli handler we call listPackages only to check if the package is already there. The owner data is not needed

Similarly in block-pkg and remove-pkg.

In the web ui, the main packages page only shows names and ids.

Note that in readPackageList, if the userID=None is given we would still have to perform the joins. I suppose we might make it an error to specify with_owners=False alongside userID=N

Pungi is calling listTagged API for fairly big tags. This usecase could also benefit from this, since the response includes owner information, but it is not needed.

Metadata Update from @tkopecek:
- Issue set to the milestone: 1.25

3 years ago

Metadata Update from @tkopecek:
- Issue tagged with: testing-ready

3 years ago

Commit 66175cc relates to this ticket

Metadata Update from @mfilip:
- Issue tagged with: testing-done

2 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #2791 Merged 2 years ago