Thread: Re: Move wal_buffers_full to WalUsage (and report it in pgss/explain)

Re: Move wal_buffers_full to WalUsage (and report it in pgss/explain)

From
Ilia Evdokimov
Date:
Hi,

Thank you for your work!

1. Perhaps In EXPLAIN you forget to check that usage->wal_buffers_full > 0:

if ((usage->wal_records > 0) || (usage->wal_fpi > 0) || 
(usage->wal_bytes > 0))


2. I have a small suggestion for pg_stat_statements: would it make sense 
to move wal_buffers_full next to wal_records, wal_fpi and wal_bytes? 
This way, all WAL-related information would be grouped together.

--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC.




Re: Move wal_buffers_full to WalUsage (and report it in pgss/explain)

From
Bertrand Drouvot
Date:
Hi,

On Tue, Feb 11, 2025 at 03:30:09PM +0300, Ilia Evdokimov wrote:
> Hi,
> 
> Thank you for your work!

Thanks for the review!

> 1. Perhaps In EXPLAIN you forget to check that usage->wal_buffers_full > 0:
> 
> if ((usage->wal_records > 0) || (usage->wal_fpi > 0) || (usage->wal_bytes >
> 0))

I don't think that's possible to have wal_buffers_full > 0 if the above returns
false. A check is done at appendStringInfo() time so I think that's ok as it is.

> 2. I have a small suggestion for pg_stat_statements: would it make sense to
> move wal_buffers_full next to wal_records, wal_fpi and wal_bytes? This way,
> all WAL-related information would be grouped together.

I think I prefer to add it in "append" order. That way, that does not break
queries that rely on ordinal numbers.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com