darold / pgbadger

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

Difference in number of queries between progress bar and overview #691

Closed gleu closed 2 years ago

gleu commented 3 years ago

Hey,

So, I had a PostgreSQL log file to analyze. I launched pgbadger on it and it tells me this:

$ ~/freeprojects/git.pgbadger/pgbadger -j4 -f stderr -p "%t [%p]: user=%u,db=%d,app=%a,client=%h,state=%e " pglogs/postgresql-Tue.log [========================>] Parsed 30449659745 bytes of 30449659745 (100.00%), queries: 12489426769, events: 46444 LOG: Ok, generating html report... Yeah, a nice 30GB log file :-D

Anyway, it tells me it found 12 billion queries. But the overview has a much lower number of queries:

overview

According to wc, I only have 63 million of lines in my log files and 30 million of "duration" lines (which should be the number of queries).

$ wc -l pglogs/postgresql-Tue.log 63557622 pglogs/postgresql-Tue.log $ grep "LOG: duration:" pglogs/postgresql-Tue.log | wc -l 30215686

I'm a bit puzzled about all this. So I'm wondering what is the number in front of queries in the progress bar? number of bytes of queries?

darold commented 2 years ago

Commit e16f20d fixes this issue.