From: Chris Sharp Date: Tue, 15 Feb 2022 20:15:37 +0000 (-0500) Subject: LP#1960956: Fix slow user merges/deletes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=951a51dcd395dbea0bb3918641d82646b4812919;p=evergreen%2Fpines.git LP#1960956: Fix slow user merges/deletes Signed-off-by: Chris Sharp Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/sql/Pg/005.schema.actors.sql b/Open-ILS/src/sql/Pg/005.schema.actors.sql index b4afa7f0f9..9a42e05427 100644 --- a/Open-ILS/src/sql/Pg/005.schema.actors.sql +++ b/Open-ILS/src/sql/Pg/005.schema.actors.sql @@ -797,6 +797,7 @@ CREATE TABLE actor.usr_message ( edit_date TIMESTAMP WITH TIME ZONE ); CREATE INDEX aum_usr ON actor.usr_message (usr); +CREATE INDEX aum_editor ON actor.usr_message (editor); ALTER TABLE actor.usr_standing_penalty ALTER COLUMN id SET DEFAULT nextval('actor.usr_message_id_seq'::regclass); ALTER TABLE actor.usr_standing_penalty ADD COLUMN usr_message BIGINT REFERENCES actor.usr_message(id); CREATE INDEX usr_standing_penalty_usr_message_idx ON actor.usr_standing_penalty (usr_message); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add_editor_index_to_usr_message.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add_editor_index_to_usr_message.sql new file mode 100644 index 0000000000..410a10bf5c --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add_editor_index_to_usr_message.sql @@ -0,0 +1,7 @@ +BEGIN; + +-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +CREATE INDEX aum_editor ON actor.usr_message (editor); + +COMMIT;