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
« Back to merge proposal
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 = [ PackageBuild, ...),
BuildFarmJob,
LeftJoin(
LeftJoin(Archive, ...),
]
if ANONYMOUS: append( LeftJoin( TeamParticipati on, ...))
...
elif ADMIN:
...
else:
origin.
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