[open-ils-commits] r18465 - in trunk/Open-ILS/src/sql/Pg: . upgrade (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Oct 25 14:31:24 EDT 2010


Author: miker
Date: 2010-10-25 14:31:20 -0400 (Mon, 25 Oct 2010)
New Revision: 18465

Modified:
   trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql
   trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
   trunk/Open-ILS/src/sql/Pg/upgrade/0445.schema.replace-connect_by.sql
Log:
quickly, before anyone notices ... minor speed enhancement (aka, thinko)

Modified: trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql	2010-10-25 18:23:44 UTC (rev 18464)
+++ trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql	2010-10-25 18:31:20 UTC (rev 18465)
@@ -204,20 +204,6 @@
           FROM  actor.org_unit ou
                 JOIN actor.org_unit_type out ON (out.id = ou.ou_type)
                 JOIN descendant_depth ot ON (ot.id = ou.parent_ou)
-    ), anscestor_depth AS (
-        SELECT  ou.id,
-                ou.parent_ou,
-                out.depth
-          FROM  actor.org_unit ou
-                JOIN actor.org_unit_type out ON (out.id = ou.ou_type)
-          WHERE ou.id = $1
-            UNION ALL
-        SELECT  ou.id,
-                ou.parent_ou,
-                out.depth
-          FROM  actor.org_unit ou
-                JOIN actor.org_unit_type out ON (out.id = ou.ou_type)
-                JOIN anscestor_depth ot ON (ot.parent_ou = ou.id)
     ) SELECT ou.* FROM actor.org_unit ou JOIN descendant_depth USING (id);
 $$ LANGUAGE SQL;
 

Modified: trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql	2010-10-25 18:23:44 UTC (rev 18464)
+++ trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql	2010-10-25 18:31:20 UTC (rev 18465)
@@ -74,20 +74,6 @@
           FROM  actor.org_unit ou
                 JOIN actor.org_unit_type out ON (out.id = ou.ou_type)
                 JOIN descendant_depth ot ON (ot.id = ou.parent_ou)
-    ), anscestor_depth AS (
-        SELECT  ou.id,
-                ou.parent_ou,
-                out.depth
-          FROM  actor.org_unit ou
-                JOIN actor.org_unit_type out ON (out.id = ou.ou_type)
-          WHERE ou.id = $1
-            UNION ALL
-        SELECT  ou.id,
-                ou.parent_ou,
-                out.depth
-          FROM  actor.org_unit ou
-                JOIN actor.org_unit_type out ON (out.id = ou.ou_type)
-                JOIN anscestor_depth ot ON (ot.parent_ou = ou.id)
     ) SELECT ou.* FROM actor.org_unit ou JOIN descendant_depth USING (id);
 $$ LANGUAGE SQL;
 

Modified: trunk/Open-ILS/src/sql/Pg/upgrade/0445.schema.replace-connect_by.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0445.schema.replace-connect_by.sql	2010-10-25 18:23:44 UTC (rev 18464)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0445.schema.replace-connect_by.sql	2010-10-25 18:31:20 UTC (rev 18465)
@@ -50,20 +50,6 @@
           FROM  actor.org_unit ou
                 JOIN actor.org_unit_type out ON (out.id = ou.ou_type)
                 JOIN descendant_depth ot ON (ot.id = ou.parent_ou)
-    ), anscestor_depth AS (
-        SELECT  ou.id,
-                ou.parent_ou,
-                out.depth
-          FROM  actor.org_unit ou
-                JOIN actor.org_unit_type out ON (out.id = ou.ou_type)
-          WHERE ou.id = $1
-            UNION ALL
-        SELECT  ou.id,
-                ou.parent_ou,
-                out.depth
-          FROM  actor.org_unit ou
-                JOIN actor.org_unit_type out ON (out.id = ou.ou_type)
-                JOIN anscestor_depth ot ON (ot.parent_ou = ou.id)
     ) SELECT ou.* FROM actor.org_unit ou JOIN descendant_depth USING (id);
 $$ LANGUAGE SQL;
 



More information about the open-ils-commits mailing list