← Back to team overview

launchpad-reviewers team mailing list archive

Re: lp:~michael.nelson/launchpad/616331-private-builds-in-builder-history into lp:launchpad

 

Review: Approve code
Hi Michael,

This is a nice improvement. Since the TeamParticipation table won't be used if the user is anonymous or an admin, it would be a small but easy optimization to not join it into those queries. For example:

origin = [
  BuildFarmJob,
  LeftJoin(PackageBuild, ...),
  LeftJoin(Archive, ...),
  ]

if ANONYMOUS:
  ...
elif ADMIN:
  ...
else:
  origin.append(LeftJoin(TeamParticipation, ...))

filtered_builds = IStore(BuildFarmJob).using(*origin).find(...)

I guess if an admin is running the query, there is no reason to use any tables besides BuildFarmJob.

-Edwin
-- 
https://code.launchpad.net/~michael.nelson/launchpad/616331-private-builds-in-builder-history/+merge/32355
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~michael.nelson/launchpad/616331-private-builds-in-builder-history into lp:launchpad.



Follow ups

References