]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0471.schema.asset-call-number-add-sortkey-compound-index.sql
LP#1744385: Additions and edits to release note entry
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0471.schema.asset-call-number-add-sortkey-compound-index.sql
1 BEGIN;
2
3 INSERT INTO config.upgrade_log (version) VALUES ('0471'); -- dbs
4
5 -- Vanquish a sequential scan in call number browsing using the simplest
6 -- possible approach; yes, there is duplication with asset.asset_call_number_label_once_per_lib
7 -- and asset.asset_call_number_label_sortkey, but let's fix the first problem
8 -- and worry about data loading time later if that turns out to be a real
9 -- problem.
10
11 CREATE INDEX asset_call_number_label_sortkey_browse ON asset.call_number(oils_text_as_bytea(label_sortkey), oils_text_as_bytea(label), id, owning_lib) WHERE deleted IS FALSE OR deleted = FALSE;
12
13 COMMIT;