diff options
author | Christopher Baines <mail@cbaines.net> | 2022-10-28 11:50:45 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-10-28 11:50:45 +0100 |
commit | 3768aec91daebb8db58e28cffe481e8878b59700 (patch) | |
tree | 11b5715086b077bd3d7b80eb85cb3285a54bffe1 /sqitch/sqlite/deploy/build_results_counts.sql | |
parent | 6cd8bd854332301edef6eee68080881b8349d768 (diff) | |
download | build-coordinator-3768aec91daebb8db58e28cffe481e8878b59700.tar build-coordinator-3768aec91daebb8db58e28cffe481e8878b59700.tar.gz |
Store build and build results counts in the database
Rather than trying to count all builds and build results at startup. This
should speed up the coordinator starting up, as currently it gets slower the
more builds and build results are in the database.
Diffstat (limited to 'sqitch/sqlite/deploy/build_results_counts.sql')
-rw-r--r-- | sqitch/sqlite/deploy/build_results_counts.sql | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sqitch/sqlite/deploy/build_results_counts.sql b/sqitch/sqlite/deploy/build_results_counts.sql new file mode 100644 index 0000000..14e7f9e --- /dev/null +++ b/sqitch/sqlite/deploy/build_results_counts.sql @@ -0,0 +1,10 @@ +-- Deploy guix-build-coordinator:build_results_counts to sqlite + +BEGIN; + +CREATE TABLE build_results_counts AS +SELECT agent_id, result, COUNT(*) AS count +FROM build_results +GROUP BY agent_id, result; + +COMMIT; |