]> git.ipfire.org Git - thirdparty/patchwork.git/commit
check distinct(user) based on just user_id
authorStewart Smith <stewart@linux.ibm.com>
Fri, 10 Aug 2018 08:01:01 +0000 (18:01 +1000)
committerStephen Finucane <stephen@that.guru>
Mon, 10 Sep 2018 20:24:24 +0000 (14:24 -0600)
commit03981421196413e8f130a9aeff607fcca47952ca
tree9205c2687eeea8f466004b94b8f49022603003dd
parent102c1571c7026798813b6ce274941fd578f39613
check distinct(user) based on just user_id

The logic to display the Check(s) on the patch list wants to really do a
DISTINCT(user_id,context) ORDER BY DATE query, but with Django that is
currently a bit Too Hard (at least for me).

But what we can do is from python just use the user_id rather than the
user object itself. Same functionality, no join or prefetching users.

This saves a couple of hundred queries on the linuxppc/list/ view and
makes loading it about 4x faster in terms of time spent in the db.

Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
patchwork/models.py