Koha/installer/data/mysql
Fridolin Somers 0573d01eaa
Bug 36033: Add more indexes to table pseudonymized_transactions
Table pseudonymized_transactions contains :
  KEY `pseudonymized_transactions_ibfk_1` (`categorycode`),
  KEY `pseudonymized_transactions_borrowers_ibfk_2` (`branchcode`),
  KEY `pseudonymized_transactions_borrowers_ibfk_3` (`transaction_branchcode`)

To improve SQL queries performance, it needs more indexes, specially on itemnumber.

Looking at table statistics :
  KEY `timeidx` (`datetime`),
  KEY `branch_idx` (`branch`),
  KEY `type_idx` (`type`),
  KEY `itemnumber_idx` (`itemnumber`),

So index is need on pseudonymized_transactions columns :
itemnumber => For join with table items
transaction_type => For filter on type issue, return ...
datetime => For filter on date, this will help cleanup script

Test plan :
1) Run updatedatabase.pl
2) Check indexes are created in table pseudonymized_transactions
3) Run SQL query :
   describe select * from pseudonymized_transactions join items using(itemnumber)
   where transaction_type='issue' and datetime < date_sub(curdate(), INTERVAL 30 DAY)
=> You see the 3 new indexes used in 'possible_keys'.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-03-22 10:35:22 +01:00
..
atomicupdate Bug 36033: Add more indexes to table pseudonymized_transactions 2024-03-22 10:35:22 +01:00
db_revs Bug 34668: DBRev 23.12.00.009 2024-03-19 18:09:06 +01:00
en
localization
mandatory Bug 34668: Add popup warn librarians of waiting holds when checking out 2024-03-19 18:09:04 +01:00
backfill_statistics.pl
fix_unclosed_nonaccruing_fines_bug17135.pl
kohastructure.sql Bug 36033: Add more indexes to table pseudonymized_transactions 2024-03-22 10:35:22 +01:00
labels_upgrade.pl
patroncards_upgrade.pl
update22to30.pl
updatedatabase.pl