]> git.ipfire.org Git - thirdparty/patchwork.git/commit
views: Prefetch 'Patch.check_set'
authorStephen Finucane <stephen.finucane@intel.com>
Tue, 15 Mar 2016 11:39:35 +0000 (11:39 +0000)
committerStephen Finucane <stephen.finucane@intel.com>
Wed, 16 Mar 2016 09:50:23 +0000 (09:50 +0000)
commit2d65dc28c4ceb2872dc838b3c3a3061486043951
tree282230d55ca7569e5b48f6ce21aa21c47e522f22
parent070083154c3cebb0f44e52fe742b00e68442ef22
views: Prefetch 'Patch.check_set'

The checks for each Patch are queried each time patches are listed.
This causes a deluge of queries (around one per patch). Mitigate this
by instead prefetching this related attribute. This reduces the number
of queries for a list of 100 patches from an average of 119 to 20.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
patchwork/views/__init__.py