Hi,

Thanks for updating the patch. I played with your benchmark [1] (with some 
top-up
fixes). Changed points:

1) Generates WAL records first then read them. Original script does 
concurrently,
   but the command measures the execution time for pg_get_wal_stats.
2) Fix the number of generated WAL record to compare the scan time.

And I got the below result (median of three runs). "WAL-disk reads" cannot be
measured because the decoding time was less than 1 second.

build    WAL direct IO  TPS       scan ms     WAL generated MB reader read MB   
    file reads   buffer hits   WAL-disk reads WAL-disk writes
PATCHED  on             2859      626         284                284            
    36357        1             235 MB/s        24.6 MB/s
PATCHED  off            3166      174         284                284            
    36353        6             0 MB/s          24.8 MB/
HEAD     on             2611      634         284                284            
    36359        0             0 MB/s          24.4 MB/s
HEAD     off            7629      106         284                284            
    36359        0             0 MB/s          27.5 MB/s

I have not analyzed via perf, but the result may show that WAL records cannot be
read from the buffer thus a round trip for WALReadFromBuffers() wasted the time.
Apart from the replication system, local read of WALs like logical decoding via
SQL functions can be done less frequently, I'm afraid that this patch might 
cause
a performance regression.

how do you feel?

[1]: 
https://www.postgresql.org/message-id/attachment/206114/nocfbot-local_wal_read_perf.sh

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Reply via email to