From 951a51dcd395dbea0bb3918641d82646b4812919 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Tue, 15 Feb 2022 15:15:37 -0500 Subject: [PATCH] LP#1960956: Fix slow user merges/deletes Signed-off-by: Chris Sharp Signed-off-by: Bill Erickson --- Open-ILS/src/sql/Pg/005.schema.actors.sql | 1 + .../sql/Pg/upgrade/XXXX.schema.add_editor_index_to_usr_message.sql | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add_editor_index_to_usr_message.sql 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; -- 2.11.0