]> granicus.if.org Git - pgbadger/commitdiff
Fix huge performance lost introduced with patch on explain plan parser.
authorGilles Darold <gilles.darold@dalibo.com>
Wed, 4 Jan 2017 12:31:34 +0000 (13:31 +0100)
committerGilles Darold <gilles.darold@dalibo.com>
Wed, 4 Jan 2017 12:31:34 +0000 (13:31 +0100)
pgbadger

index c129dc295858d9c1f67a7340f6ee272d653a6db4..2de31cca1427cd39ad9d9a419def4be56a031c64 100644 (file)
--- a/pgbadger
+++ b/pgbadger
@@ -3061,7 +3061,7 @@ sub parse_orphan_line
 
                $cur_info{$cur_pid}{parameters} .= " $line" if (!$error_only);
 
-       } elsif (exists $cur_plan_info{$cur_pid}{duration}) {
+       } elsif (exists $cur_plan_info{$cur_pid}) {
 
                $cur_plan_info{$cur_pid}{plan} .= "\n" . $line;
 
@@ -12943,7 +12943,7 @@ sub set_current_infos
        $cur_info{$t_pid}{bind}      = $prefix_vars{'t_bind'} if (!$cur_info{$t_pid}{bind});
 
        # Extract the query part from the plan
-       if (exists $cur_plan_info{$t_pid}{plan} && ($cur_plan_info{$t_pid}{plan} ne '')) {
+       if (exists $cur_plan_info{$t_pid} && exists $cur_plan_info{$t_pid}{plan} && $cur_plan_info{$t_pid}{plan} ne '') {
                my $key = 'query';
                my @plan = split("\n", $cur_plan_info{$t_pid}{plan});
                $plan[0] =~ s/^\s*Query Text:\s+//;