Re: define pg_structiszero(addr, s, r)

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: define pg_structiszero(addr, s, r)
Date: 2024-09-18 06:07:15
Message-ID: ZupuE74kkcC_LhGy@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 18, 2024 at 04:16:12AM +0000, Bertrand Drouvot wrote:
> The macro is created in pgstat_internal.h as it looks like that "only" the
> statistics related code would benefit of it currently (could be moved to other
> header file later on if needed).

I'm OK to add a helper macro in pgstat_internal.h as this is a pattern
used only for some stats kinds (the other one I'm aware of is the
allzero check for pages around bufmgr.c), cleaning up all these static
declarations to make the memcpy() calls cheaper. That can also be
useful for anybody doing a custom pgstats kind, fixed or
variable-numbered.

#define pg_structiszero(addr, s, r) \

Locating that at the top of pgstat_internal.h seems a bit out of order
to me. Perhaps it would be better to move it closer to the inline
functions?

Also, is this the best name to use here? Right, this is something
that may be quite generic. However, if we limit its scope in the
stats, perhaps this should be named pgstat_entry_all_zeros() or
something like that?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message nikhil raj 2024-09-18 06:19:30 Re: Significant Execution Time Difference Between PG13.14 and PG16.4 for Query on information_schema Tables.
Previous Message Sven Klemm 2024-09-18 06:04:03 Re: Regression tests fail with tzdata 2024b