From: blake Date: Tue, 10 Apr 2018 00:52:08 +0000 (-0500) Subject: LP1758160_Deleting_patrons_can_exceed_staff_client_timeouts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=07bd64f0d354f86179c3bc7fddce6c6492304f2b;p=working%2FEvergreen.git LP1758160_Deleting_patrons_can_exceed_staff_client_timeouts Added an index to action.usr_circ_history for much needed postgresql justice. This will increase the speed when deleting patrons with large number of circulations. Signed-off-by: blake --- diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql index 7d06aba9fb..2fb3659e6c 100644 --- a/Open-ILS/src/sql/Pg/090.schema.action.sql +++ b/Open-ILS/src/sql/Pg/090.schema.action.sql @@ -1547,6 +1547,7 @@ CREATE TABLE action.usr_circ_history ( ); CREATE INDEX action_usr_circ_history_usr_idx ON action.usr_circ_history ( usr ); +CREATE INDEX action_usr_circ_history_source_circ_idx ON action.usr_circ_history ( source_circ ); CREATE TRIGGER action_usr_circ_history_target_copy_trig AFTER INSERT OR UPDATE ON action.usr_circ_history diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.lp1758160_deleting_patrons_can_exceed_staff_client_timeouts.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.lp1758160_deleting_patrons_can_exceed_staff_client_timeouts.sql new file mode 100644 index 0000000000..a9b89b82f6 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.lp1758160_deleting_patrons_can_exceed_staff_client_timeouts.sql @@ -0,0 +1,7 @@ + +-- Fixes slowness when deleting patrons + +CREATE INDEX action_usr_circ_history_source_circ_idx + ON action.usr_circ_history + USING btree + (source_circ);