Bug 26535 - Remove issues old_issues redundant indexes
Summary: Remove issues old_issues redundant indexes
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Didier Gautheron
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-25 08:56 UTC by Didier Gautheron
Modified: 2021-04-22 11:26 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 26535: Remove issues tables redundant indexes (1.64 KB, patch)
2020-09-25 09:44 UTC, Didier Gautheron
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Didier Gautheron 2020-09-25 08:56:44 UTC
issues and old_issues have redundant indexes.

Removing them seems to reduce dead locks occurrences.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26457

This patch doesn't try to remove existing indexes it only change DB structure for new instances.
Comment 1 Didier Gautheron 2020-09-25 09:44:13 UTC
Created attachment 110735 [details] [review]
Bug 26535: Remove issues tables redundant indexes
Comment 2 Katrin Fischer 2020-09-25 10:33:14 UTC
Hi Didier,

I think this is good, but is there a reason not to fix the existing installations of this is causing an issue? We aim to keep the database structure in sync. There are handy methods for checking on the existence of an index in the updatedatabase script that could be useful here.
Comment 3 Didier Gautheron 2020-09-25 14:06:23 UTC
Hi,
(In reply to Katrin Fischer from comment #2)
> Hi Didier,
> 
> I think this is good, but is there a reason not to fix the existing
> installations of this is causing an issue? We aim to keep the database
> structure in sync. There are handy methods for checking on the existence of
> an index in the updatedatabase script that could be useful here.
Mostly reliability.
I'm not sure testing on index name is enough, other index must exist, use the right columns, and it must be more restrictive than the deleted one.
Comment 4 Katrin Fischer 2020-09-25 14:13:43 UTC
(In reply to didier from comment #3)
> Hi,
> (In reply to Katrin Fischer from comment #2)
> > Hi Didier,
> > 
> > I think this is good, but is there a reason not to fix the existing
> > installations of this is causing an issue? We aim to keep the database
> > structure in sync. There are handy methods for checking on the existence of
> > an index in the updatedatabase script that could be useful here.
> Mostly reliability.
> I'm not sure testing on index name is enough, other index must exist, use
> the right columns, and it must be more restrictive than the deleted one.

Maybe remove them all and recreate then?
Comment 5 Fridolin Somers 2020-12-16 14:20:03 UTC
We may remove 'bordate' index, it is not safe to use timestamp into an index.
I cant find what it is for exactly.
But with ORM use, this is likly to be useless.