Re: Compilation issues for HASH_STATISTICS and HASH_DEBUG options

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2025-08-18T01:10:40Z
Lists: pgsql-hackers
On Mon, Aug 18, 2025 at 12:56:02PM +1200, David Rowley wrote:
> One last thing, in order to inform people of breakages sooner than a
> post-commit report from the buildfarm, I wondered is if we should do:
> 
> -#ifdef HASH_DEBUG
> +#if defined(HASH_DEBUG) || defined(USE_ASSERT_CHECKING)
> 
> The HASH_DEBUG does not add any extra fields, so the overhead only
> amounts to the elog(DEBUG4) line.  HASH_STATISTICS adds extra fields
> and counter incrementing, so I don't propose the same treatment for
> that.

If we do that, I guess that we could just remove HASH_DEBUG, keeping
only HASH_STATISTICS.
--
Michael

Commits

  1. Remove HASH_DEBUG output from dynahash.c

  2. Use elog(DEBUG4) for dynahash.c statistics output

  3. Fix invalid format string in HASH_DEBUG code

  4. Fix failing -D HASH_STATISTICS builds

  5. Refactor initial hash lookup in dynahash.c

  6. Remove large fill factor support from dynahash.c.

  7. Remove broken and useless entry-count printing in HASH_DEBUG code.

  8. Partition the freelist for shared dynahash tables.