darold / pgbadger

A fast PostgreSQL Log Analyzer
http://pgbadger.darold.net/
PostgreSQL License
3.51k stars 349 forks source link

No times for SQL #684

Closed mgogala closed 3 years ago

mgogala commented 3 years ago

I ran pgbadger on one of my logs like this: bash-4.4$ pgbadger postgresql-Tue.log -o /tmp/pg_17-AUG-2021.html -j 2 [========================>] Parsed 7112864191 bytes of 7112864191 (100.00%), queries: 26951043300, events: 68 LOG: Ok, generating html report... bash-4.4$

The HTML report is attached. pg_17-AUG-2021.zip

I am looking into time consuming queries. All times are 0 and there are no details for any query.

mgogala commented 3 years ago

This is happening ever since the upgrade to 13.4. It looks like pgbadger is in need of an upgrade.

darold commented 3 years ago

Can you post a line of your log file where there is a query?

mgogala commented 3 years ago

The log file is attached. It doesn't contain any valuable data. log.zip

darold commented 3 years ago

You must disable log_duration in your postgresql.conf actually it erase the pgbadger statistics collected though log_min_duration.

mgogala commented 3 years ago

It is disabled:

- What to Log -

debug_print_parse = off

debug_print_rewritten = off

debug_print_plan = off

debug_pretty_print = on

log_checkpoints = on

log_connections = off

log_disconnections = off

log_duration = off

log_error_verbosity = default # terse, default, or verbose messages

log_hostname = off

log_line_prefix = '%m [%p] '

I didn't change that parameter. Log_min_duration is disabled as well. I have set it through "ALTER USER" parameter for one particular user.

mgogala commented 3 years ago

You are right. After setting log_min_duration_statement to 0, the whole thing works again. I was too smart for my own good.