LP#1960956: Fix slow user merges/deletes
authorChris Sharp <csharp@georgialibraries.org>
Tue, 15 Feb 2022 20:15:37 +0000 (15:15 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 16 Mar 2022 18:34:45 +0000 (14:34 -0400)
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/sql/Pg/005.schema.actors.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.add_editor_index_to_usr_message.sql [new file with mode: 0644]

index b4afa7f..9a42e05 100644 (file)
@@ -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 (file)
index 0000000..410a10b
--- /dev/null
@@ -0,0 +1,7 @@
+BEGIN;
+
+-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE INDEX aum_editor ON actor.usr_message (editor);
+
+COMMIT;