]> 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)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Thu, 26 Jan 2023 13:18:17 +0000 (14:18 +0100)
commit020f7777246db96521030dc109c5fc480e33d4ab
tree5d6601218908cb18d0a771ce9588ed7696fb6f49
parentb9140b31a5cd0f9842aaa65b576a9f3488a0fe0e
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>
(cherry picked from commit 8755f775990bba513480a3b54372d76395ab2fbe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f2ec246fd6f16224a556e073e28479ca5104949e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a579ff4fe46d1c6a74942087a8aebdcb303829e6)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
installer/data/mysql/atomicupdate/bug_32330.pl [new file with mode: 0755]
installer/data/mysql/kohastructure.sql