]> git.koha-community.org Git - koha.git/commit
Bug 32330: Add indexes to table background_jobs
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 23 Nov 2022 06:49:02 +0000 (20:49 -1000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 16 Dec 2022 18:51:47 +0000 (15:51 -0300)
commit8755f775990bba513480a3b54372d76395ab2fbe
tree5e4f9b8e7e425a1724a1783e3c7949710190ea39
parent3dcdd6db788b2c23320ca24a900d37d0454dbbec
Bug 32330: Add indexes to table background_jobs

Table background_jobs should have indexes to optimize queries.

Query on borrowernumber :
mainpage.pl:    my $already_ran_jobs = Koha::BackgroundJobs->search(
mainpage.pl-        { borrowernumber => $logged_in_user->borrowernumber } )->count ? 1 : 0;

Query on status and queue :
misc/background_jobs_worker.pl:        my $jobs = Koha::BackgroundJobs->search({ status => 'new', queue => \@queues });

Test plan :
Run updatedatabase and play with background jobs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
installer/data/mysql/atomicupdate/bug_32330.pl [new file with mode: 0755]
installer/data/mysql/kohastructure.sql