Re: Make pg_stat_io view count IOs as bytes instead of blocks

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Make pg_stat_io view count IOs as bytes instead of blocks
Date: 2025-01-16 04:14:31
Message-ID: Z4iHpk0eD9kmOA25@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 15, 2025 at 12:19:03PM -0500, Tom Lane wrote:
> I don't see a reasonable way to alter that check to suppress this;
> for instance, "(io_op) <= IOOP_WRITE" would probably still draw the
> same warning. I think most likely we have to remove that check, ie
>
> #define pgstat_is_ioop_tracked_in_bytes(io_op) \
> - ((io_op) < IOOP_NUM_TYPES && (io_op) >= IOOP_EXTEND)
> + ((io_op) >= IOOP_EXTEND)
>
> I suppose one alternative is to re-order the enum so that the
> upper-limit check in this macro *isn't* tautological ... but
> that seems a bit silly.

I cannot reproduce that, perhaps I'm just missing something with these
switches. Do you think that a cast would cool things? Please see the
attached for the idea.
--
Michael

Attachment Content-Type Size
pgstat_io_warning.patch text/x-diff 567 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2025-01-16 04:16:34 Re: Pgoutput not capturing the generated columns
Previous Message Peter Smith 2025-01-16 03:57:49 TOAST versus toast