my $t_action = '';
# Store query duration generated by log_min_duration >= 0 in postgresql.conf
- if ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms (query|statement): //is) {
+ if ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms\s+(query|statement): //is) {
$prefix_vars{'t_duration'} = $1;
$t_action = $2;
my $k = &get_hist_inbound($1, @histogram_query_time);
return if (lc($1) eq 'prepare');
}
# Log line with duration and statement from prepared queries
- } elsif ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms (prepare|parse|bind|execute from fetch|execute)\s+[^:]+:\s//is)
+ } elsif ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms\s+(prepare|parse|bind|execute from fetch|execute)\s+[^:]+:\s//is)
{
$prefix_vars{'t_duration'} = $1;
$t_action = $2;
$overall_stat{histogram}{query_total}++;
$prefix_vars{'t_bind'} = 1;
# Activate storage of the explain plan generated by auto_explain
- } elsif ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms plan://is) {
+ } elsif ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms\s+plan://is) {
$cur_plan_info{$t_pid}{duration} = $1;
# Log line without duration at all
} elsif ($prefix_vars{'t_query'} =~ s/(query|statement): //is) {