LP1223903 - Add indexes to authority.record_entry.
authorJason Stephenson <jstephenson@mvlc.org>
Tue, 10 Dec 2013 20:16:21 +0000 (15:16 -0500)
committerBen Shum <bshum@biblio.org>
Wed, 19 Feb 2014 19:34:58 +0000 (14:34 -0500)
We want indexes on edit_date and create_date for authority.record_entry
so that date-based searching is faster for authority record export.  It
likely will prove useful for other features.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/sql/Pg/011.schema.authority.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.index.authority_record_entry.sql [new file with mode: 0644]

index d40bf31..7033773 100644 (file)
@@ -135,6 +135,8 @@ CREATE TABLE authority.record_entry (
 );
 CREATE INDEX authority_record_entry_creator_idx ON authority.record_entry ( creator );
 CREATE INDEX authority_record_entry_editor_idx ON authority.record_entry ( editor );
+CREATE INDEX authority_record_entry_create_date_idx ON authority.record_entry ( create_date );
+CREATE INDEX authority_record_entry_edit_date_idx ON authority.record_entry ( edit_date );
 CREATE INDEX authority_record_deleted_idx ON authority.record_entry(deleted) WHERE deleted IS FALSE OR deleted = false;
 CREATE TRIGGER a_marcxml_is_well_formed BEFORE INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE biblio.check_marcxml_well_formed();
 CREATE TRIGGER b_maintain_901 BEFORE INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE evergreen.maintain_901();
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.index.authority_record_entry.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.index.authority_record_entry.sql
new file mode 100644 (file)
index 0000000..1c8e03c
--- /dev/null
@@ -0,0 +1,2 @@
+CREATE INDEX authority_record_entry_create_date_idx ON authority.record_entry ( create_date );
+CREATE INDEX authority_record_entry_edit_date_idx ON authority.record_entry ( edit_date );