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

Evergreen Git git at git.evergreen-ils.org
Sat Jul 16 12:59:44 EDT 2011


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  318efe47c1d58d6db25e9434829a7b55d7cced10 (commit)
       via  a6365e9fdaf7ee4ab01a5c18971244076c80c5c7 (commit)
      from  df92ad3797667f00c93c100fd9c7be7890007670 (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 318efe47c1d58d6db25e9434829a7b55d7cced10
Author: Mike Rylander <mrylander at gmail.com>
Date:   Sat Jul 16 12:56:32 2011 -0400

    Stamping upgrade script for "Bad join condition all_circulation view"
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index da9bebb..00ab333 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,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 ('0581', :eg_version); -- tsbere via miker
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0582', :eg_version); -- miker
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXX.schema.aging_circ_view.sql b/Open-ILS/src/sql/Pg/upgrade/0582.schema.aging_circ_view.sql
similarity index 91%
rename from Open-ILS/src/sql/Pg/upgrade/XXX.schema.aging_circ_view.sql
rename to Open-ILS/src/sql/Pg/upgrade/0582.schema.aging_circ_view.sql
index 8e3c440..02972fd 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXX.schema.aging_circ_view.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0582.schema.aging_circ_view.sql
@@ -1,3 +1,12 @@
+-- Evergreen DB patch 0582.schema.aging_circ_view.sql
+--
+--
+BEGIN;
+
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0582', :eg_version);
+
 CREATE OR REPLACE VIEW action.all_circulation AS
     SELECT  id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
         copy_owning_lib, copy_circ_lib, copy_bib_record, xact_start, xact_finish, target_copy,
@@ -21,3 +30,6 @@ CREATE OR REPLACE VIEW action.all_circulation AS
         LEFT JOIN actor.usr_address a ON (p.mailing_address = a.id)
         LEFT JOIN actor.usr_address b ON (p.billing_address = b.id);
 
+
+
+COMMIT;

commit a6365e9fdaf7ee4ab01a5c18971244076c80c5c7
Author: Mike Rylander <mrylander at gmail.com>
Date:   Sat Jul 16 12:53:13 2011 -0400

    Bad join condition in secondary (physical) address lookup, causing terrible performance of circ aging
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql
index f15107d..44a3236 100644
--- a/Open-ILS/src/sql/Pg/090.schema.action.sql
+++ b/Open-ILS/src/sql/Pg/090.schema.action.sql
@@ -212,7 +212,7 @@ CREATE OR REPLACE VIEW action.all_circulation AS
         JOIN asset.call_number cn ON (cp.call_number = cn.id)
         JOIN actor.usr p ON (circ.usr = p.id)
         LEFT JOIN actor.usr_address a ON (p.mailing_address = a.id)
-        LEFT JOIN actor.usr_address b ON (p.billing_address = a.id);
+        LEFT JOIN actor.usr_address b ON (p.billing_address = b.id);
 
 CREATE OR REPLACE FUNCTION action.age_circ_on_delete () RETURNS TRIGGER AS $$
 DECLARE
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXX.schema.aging_circ_view.sql b/Open-ILS/src/sql/Pg/upgrade/XXX.schema.aging_circ_view.sql
new file mode 100644
index 0000000..8e3c440
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXX.schema.aging_circ_view.sql
@@ -0,0 +1,23 @@
+CREATE OR REPLACE VIEW action.all_circulation AS
+    SELECT  id,usr_post_code, usr_home_ou, usr_profile, usr_birth_year, copy_call_number, copy_location,
+        copy_owning_lib, copy_circ_lib, copy_bib_record, xact_start, xact_finish, target_copy,
+        circ_lib, circ_staff, checkin_staff, checkin_lib, renewal_remaining, grace_period, due_date,
+        stop_fines_time, checkin_time, create_time, duration, fine_interval, recurring_fine,
+        max_fine, phone_renewal, desk_renewal, opac_renewal, duration_rule, recurring_fine_rule,
+        max_fine_rule, stop_fines, workstation, checkin_workstation, checkin_scan_time, parent_circ
+      FROM  action.aged_circulation
+            UNION ALL
+    SELECT  DISTINCT circ.id,COALESCE(a.post_code,b.post_code) AS usr_post_code, p.home_ou AS usr_home_ou, p.profile AS usr_profile, EXTRACT(YEAR FROM p.dob)::INT AS usr_birth_year,
+        cp.call_number AS copy_call_number, cp.location AS copy_location, cn.owning_lib AS copy_owning_lib, cp.circ_lib AS copy_circ_lib,
+        cn.record AS copy_bib_record, circ.xact_start, circ.xact_finish, circ.target_copy, circ.circ_lib, circ.circ_staff, circ.checkin_staff,
+        circ.checkin_lib, circ.renewal_remaining, circ.grace_period, circ.due_date, circ.stop_fines_time, circ.checkin_time, circ.create_time, circ.duration,
+        circ.fine_interval, circ.recurring_fine, circ.max_fine, circ.phone_renewal, circ.desk_renewal, circ.opac_renewal, circ.duration_rule,
+        circ.recurring_fine_rule, circ.max_fine_rule, circ.stop_fines, circ.workstation, circ.checkin_workstation, circ.checkin_scan_time,
+        circ.parent_circ
+      FROM  action.circulation circ
+        JOIN asset.copy cp ON (circ.target_copy = cp.id)
+        JOIN asset.call_number cn ON (cp.call_number = cn.id)
+        JOIN actor.usr p ON (circ.usr = p.id)
+        LEFT JOIN actor.usr_address a ON (p.mailing_address = a.id)
+        LEFT JOIN actor.usr_address b ON (p.billing_address = b.id);
+

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

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/090.schema.action.sql          |    2 +-
 .../sql/Pg/upgrade/0582.schema.aging_circ_view.sql |   35 ++++++++++++++++++++
 3 files changed, 37 insertions(+), 2 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0582.schema.aging_circ_view.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list