[open-ils-commits] [GIT] Evergreen ILS branch master updated. a6d3bdea207394fafc8caf92dcd18843410fcb2e

Evergreen Git git at git.evergreen-ils.org
Fri Jun 10 11:54:31 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  a6d3bdea207394fafc8caf92dcd18843410fcb2e (commit)
       via  d947d7ca90bfdae26f261efc5e79aba85ea066cd (commit)
      from  0fa5935d249fa42131844f327d8ce6cc2977ce45 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a6d3bdea207394fafc8caf92dcd18843410fcb2e
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Fri Jun 10 11:51:41 2016 -0400

    LP#1526858: Stamping upgrade script for faster alhr query
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 23f4074..7a011f0 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -91,7 +91,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0980', :eg_version); -- DPearl/kmlussier
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0981', :eg_version); -- gmcharlt/jlundgren/kmlussier
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.indexes_for_alhr_queries.sql b/Open-ILS/src/sql/Pg/upgrade/0981.schema.indexes_for_alhr_queries.sql
similarity index 82%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.indexes_for_alhr_queries.sql
rename to Open-ILS/src/sql/Pg/upgrade/0981.schema.indexes_for_alhr_queries.sql
index afc83b8..5b84cc2 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.indexes_for_alhr_queries.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0981.schema.indexes_for_alhr_queries.sql
@@ -1,6 +1,6 @@
 BEGIN;
 
---SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); 
+SELECT evergreen.upgrade_deps_block_check('0981', :eg_version); 
 
 CREATE INDEX hold_request_copy_capture_time_idx ON action.hold_request (current_copy,capture_time);
 CREATE INDEX hold_request_open_captured_shelf_lib_idx ON action.hold_request (current_shelf_lib) WHERE capture_time IS NOT NULL AND fulfillment_time IS NULL AND (pickup_lib <> current_shelf_lib);

commit d947d7ca90bfdae26f261efc5e79aba85ea066cd
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Wed Dec 16 11:03:42 2015 -0500

    LP#1526858: speed up queries for shelf-expired holds during checkin
    
    This patch adds indexes on action.hold_request and tweaks
    the definition of the alhr IDL view to more efficiently
    identify holds that can be canceled if the "Clear Holds Shelf"
    checkin modifier is in use.  This can prevent a problem
    where such checkins can time out in very large databases.
    
    The tweaks were created by Jason Etheridge and have been in
    production at a large consortium for some time.
    
    To test
    -------
    [1] With a suitably large database, set up an item that
        is on the holds shelf but has passed its shelf-expiration
        time, then check it in using the "Clear Holds Shelf" modifier.
    [2] The checkin may fail with a "network failure" message due
        the query on the alhr timing out.
    [3] Apply the patch and repeat step 1. This time, the checkin
        should succeed.
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Jeanette Lundgren <jlundgren at cwmars.org>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index a6b74fd..7bca4f2 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -5766,7 +5766,7 @@ SELECT  usr,
 	</class>
 	<class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
 		<oils_persist:source_definition>
-			SELECT ahr.* FROM action.hold_request ahr JOIN (SELECT current_copy, MAX(capture_time) AS capture_time FROM action.hold_request WHERE capture_time IS NOT NULL GROUP BY current_copy)x USING (current_copy, capture_time)
+			SELECT ahr.* FROM action.hold_request ahr JOIN (SELECT current_copy, MAX(capture_time) AS capture_time FROM action.hold_request WHERE capture_time IS NOT NULL AND current_copy IS NOT NULL AND fulfillment_time IS NULL GROUP BY current_copy)x USING (current_copy, capture_time)
 		</oils_persist:source_definition>
 		<fields oils_persist:primary="id">
 			<field reporter:label="Status" name="status" oils_persist:virtual="true" />
diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql
index 74b2ca4..c79793a 100644
--- a/Open-ILS/src/sql/Pg/090.schema.action.sql
+++ b/Open-ILS/src/sql/Pg/090.schema.action.sql
@@ -430,6 +430,8 @@ CREATE INDEX hold_request_requestor_idx         ON action.hold_request ( request
 CREATE INDEX hold_request_open_idx ON action.hold_request (id) WHERE cancel_time IS NULL AND fulfillment_time IS NULL;
 CREATE INDEX hold_request_current_copy_before_cap_idx ON action.hold_request (current_copy) WHERE capture_time IS NULL AND cancel_time IS NULL;
 CREATE UNIQUE INDEX hold_request_capture_protect_idx ON action.hold_request (current_copy) WHERE current_copy IS NOT NULL AND capture_time IS NOT NULL AND cancel_time IS NULL AND fulfillment_time IS NULL;
+CREATE INDEX hold_request_copy_capture_time_idx ON action.hold_request (current_copy,capture_time);
+CREATE INDEX hold_request_open_captured_shelf_lib_idx ON action.hold_request (current_shelf_lib) WHERE capture_time IS NOT NULL AND fulfillment_time IS NULL AND (pickup_lib <> current_shelf_lib);
 
 
 CREATE TABLE action.hold_request_note (
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.indexes_for_alhr_queries.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.indexes_for_alhr_queries.sql
new file mode 100644
index 0000000..afc83b8
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.indexes_for_alhr_queries.sql
@@ -0,0 +1,8 @@
+BEGIN;
+
+--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); 
+
+CREATE INDEX hold_request_copy_capture_time_idx ON action.hold_request (current_copy,capture_time);
+CREATE INDEX hold_request_open_captured_shelf_lib_idx ON action.hold_request (current_shelf_lib) WHERE capture_time IS NOT NULL AND fulfillment_time IS NULL AND (pickup_lib <> current_shelf_lib);
+
+COMMIT;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |    2 +-
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/090.schema.action.sql          |    2 ++
 .../0981.schema.indexes_for_alhr_queries.sql       |    8 ++++++++
 4 files changed, 12 insertions(+), 2 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0981.schema.indexes_for_alhr_queries.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list