[open-ils-commits] [GIT] Evergreen ILS branch rel_2_4 updated. 199f25958dcccb992e3b62ed9fc605c792396414

Evergreen Git git at git.evergreen-ils.org
Thu Sep 12 13:46:18 EDT 2013


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, rel_2_4 has been updated
       via  199f25958dcccb992e3b62ed9fc605c792396414 (commit)
      from  e330dd4c20b1b8ccb7375b4a326069521a0879b4 (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 199f25958dcccb992e3b62ed9fc605c792396414
Author: Mike Rylander <mrylander at gmail.com>
Date:   Thu Sep 12 13:13:23 2013 -0400

    Optimize container filters in QueryParser
    
    When a container filter is used at the top level of a QueryParser
    query (that is, in a simple query with no OR-logic branches or explicit
    nesting groups) we can use an INNER join instead of LEFT + IS NOT NULL.
    
    On some production datasets this showed an increase in performance from
    20+ seconds to 1ms for the core query.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
index 431e26f..98f6c1d 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
@@ -1094,12 +1094,13 @@ sub flatten {
                         }
                         $with .= "     )";
 
-                        $from .= "\n" . ${spc} x 3 . "LEFT JOIN container_${filter_alias} ON container_${filter_alias}.record = m.source";
+                        my $optimize_join = 1 if $self->top_plan and !$NOT;
+                        $from .= "\n" . ${spc} x 3 . ( $optimize_join ? 'INNER' : 'LEFT') . " JOIN container_${filter_alias} ON container_${filter_alias}.record = m.source";
 
-                        my $spcdepth = $self->plan_level + 5;
-
-                        $where .= $joiner if $where ne '';
-                        $where .= "${NOT}(container_${filter_alias} IS NOT NULL)";
+                        if (!$optimize_join) {
+                            $where .= $joiner if $where ne '';
+                            $where .= "(container_${filter_alias} IS " . ( $NOT ? 'NULL)' : 'NOT NULL)');
+                        }
                     }
                 }
             } elsif ($filter->name eq 'record_list') {

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

Summary of changes:
 .../Application/Storage/Driver/Pg/QueryParser.pm   |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list