2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/data-service.git synced 2023-12-14 03:23:03 +01:00
data-service/sqitch/verify/change_load_new_guix_revision_job_logs_contents_to_be_nullable.sql
Christopher Baines 2ea78cff47 Tweak how logs are stored
Previously, the query for the jobs page was really slow, as it checked the
load_new_guix_revision_job_log_parts table for each job, doing a sequential
scan through the potentially large table.

Adding an index didn't seem to help, as the query planner would belive the
query could return loads of rows, where actually, all that needed checking is
whether a single row existed with a given job_id.

To avoid adding the index to the load_new_guix_revision_job_log_parts table,
and fighting with the query planner, this commit changes the
load_new_guix_revision_job_logs table to include a blank entry for jobs which
are currently being processed. This is inserted at the start of the job, and
then updated at the end to combine and replace all the parts.

This all means that the jobs page should render quickly now.
2019-07-07 21:23:18 +01:00

8 lines
148 B
PL/PgSQL

-- Verify guix-data-service:change_load_new_guix_revision_job_logs_contents_to_be_nullable on pg
BEGIN;
-- XXX Add verifications here.
ROLLBACK;