Bugzilla – Attachment 189594 Details for
Bug 41248
Add ability for real time holds queue background jobs to skip duplicate jobs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41248: Add index on background_jobs.data
Bug-41248-Add-index-on-backgroundjobsdata.patch (text/plain), 2.16 KB, created by
Kyle M Hall (khall)
on 2025-11-14 11:39:27 UTC
(
hide
)
Description:
Bug 41248: Add index on background_jobs.data
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-11-14 11:39:27 UTC
Size:
2.16 KB
patch
obsolete
>From bb15d91b44d8f45995b0f38adf034a87d39989c0 Mon Sep 17 00:00:00 2001 >From: John Doe <you@example.com> >Date: Fri, 14 Nov 2025 11:32:02 +0000 >Subject: [PATCH] Bug 41248: Add index on background_jobs.data > >Index decreases search result time from 1.6 seconds to 0.001 seconds on 153,205 rows > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../data/mysql/atomicupdate/bug_41248.pl | 24 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 3 ++- > 2 files changed, 26 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_41248.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_41248.pl b/installer/data/mysql/atomicupdate/bug_41248.pl >new file mode 100755 >index 00000000000..ebc5d19a6e2 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_41248.pl >@@ -0,0 +1,24 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "41248", >+ description => "Add index on background_jobs.data", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ unless ( index_exists( 'background_jobs', 'idx_data_255' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE background_jobs >+ ADD INDEX idx_data_255 (data(255)); >+ } >+ ); >+ >+ say_success( $out, "Added index idx_data_255 for background_jobs.data" ); >+ } else { >+ say_info( $out, "Index idx_data_255 for background_jobs.data already exists" ); >+ } >+ } >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index d3b36dca871..c261f75b609 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1084,7 +1084,8 @@ CREATE TABLE `background_jobs` ( > PRIMARY KEY (`id`), > KEY `borrowernumber` (`borrowernumber`), > KEY `queue` (`queue`), >- KEY `status` (`status`) >+ KEY `status` (`status`), >+ KEY `idx_data_255` (`data`(255)) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >-- >2.50.1 (Apple Git-155)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41248
:
189567
|
189569
|
189570
|
189571
|
189581
|
189582
|
189593
| 189594