diff options
author | Dan McGee <dan@archlinux.org> | 2012-04-27 16:24:34 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-04-27 16:24:34 +0200 |
commit | 80e7d19726a95b40727b7f35b9ad80b436b14b93 (patch) | |
tree | 12ba9aa51efb35c3b2bc91cd09913eff3829e5fb /templates/devel/index.html | |
parent | 4e1e28729f97eb694cdcae2f3fe51b5178963069 (diff) | |
download | archweb-80e7d19726a95b40727b7f35b9ad80b436b14b93.tar.gz archweb-80e7d19726a95b40727b7f35b9ad80b436b14b93.tar.xz |
Dev dashboard performance improvement
Rather than one query per cell in the arches and repos statistics
tables, we can group these together up front using Django annotations.
This means we only need one query per table.
In my local instance with all of the staging repos imported, this
reduces the total query count on this page from 56 to 26, a rather
marked improvement.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'templates/devel/index.html')
-rw-r--r-- | templates/devel/index.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/devel/index.html b/templates/devel/index.html index a0ccb91..c67cf27 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -194,10 +194,10 @@ <td>{{ arch.name }}</td> <td><a href="/packages/?arch={{ arch.name }}" title="View all packages for the {{ arch.name }} architecture"> - <strong>{{ arch.packages.count }}</strong> packages</a></td> + <strong>{{ arch.total_ct }}</strong> packages</a></td> <td><a href="/packages/?arch={{ arch.name }}&flagged=Flagged" title="View all flagged packages for the {{ arch.name }} architecture"> - <strong>{{ arch.packages.flagged.count }}</strong> packages</a></td> + <strong>{{ arch.flagged_ct }}</strong> packages</a></td> </tr> {% endfor %} </tbody> @@ -224,10 +224,10 @@ <td>{{ repo.name }}</td> <td><a href="/packages/?repo={{ repo.name }}" title="View all packages in the {{ repo.name }} repository"> - <strong>{{ repo.packages.count }}</strong> packages</a></td> + <strong>{{ repo.total_ct }}</strong> packages</a></td> <td><a href="/packages/?repo={{ repo.name }}&flagged=Flagged" title="View all flagged packages in the {{ repo.name }} repository"> - <strong>{{ repo.packages.flagged.count }}</strong> packages</a></td> + <strong>{{ repo.flagged_ct }}</strong> packages</a></td> </tr> {% endfor %} </tbody> |