Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump. - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.
Date
Msg-id 20201204.152047.1606427486743708152.horikyota.ntt@gmail.com
Whole thread Raw
In response to RE: Wrong statistics for size of XLOG_SWITCH during pg_waldump.  (<Shinya11.Kato@nttdata.com>)
Responses RE: Wrong statistics for size of XLOG_SWITCH during pg_waldump.
List pgsql-hackers
Thanks for taking a look on this.

At Fri, 4 Dec 2020 04:20:47 +0000, <Shinya11.Kato@nttdata.com> wrote in 
> When I execute pg_waldump, I found that XLOG/SWITCH_JUNK appears twice.
> Is this problem solved by the way of correcting the previously discussed Transaction/COMMIT?
> 
> $ ../bin/pg_waldump --stats=record ../data/pg_wal/000000010000000000000001
> Type                                           N      (%)          Record size      (%)             FPI size      (%)
      Combined size      (%)
 
> ----                                           -      ---          -----------      ---             --------      ---
      -------------      ---
 
..
> XLOG/SWITCH_JUNK                               0 (  0.00)                    0 (  0.00)                    0 (  0.00)
                  0 (  0.00)
 
...
> XLOG/SWITCH_JUNK                               0 (  0.00)                    0 (  0.00)                    0 (  0.00)
                  0 (  0.00)
 

Yeah, that's because of XLogDumpDisplayStats forgets to consider ri
(rmgr id) when showing the lines. If there's a record with info = 0x04
for other resources than RM_XLOG_ID, the spurious line is shown.

The first one is for XLOG_HEAP2_VISIBLE and the latter is for
XLOG_HEAP_HOT_UPDATE, that is, both of which are not for XLOG_SWITCH..

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit
Next
From: Bharath Rupireddy
Date:
Subject: Re: A new function to wait for the backend exit after termination