Re: Compilation issues for HASH_STATISTICS and HASH_DEBUG options
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: 'Tom Lane' <tgl@sss.pgh.pa.us>, "'pgsql-hackers@lists.postgresql.org'" <pgsql-hackers@lists.postgresql.org>
Date: 2025-08-15T03:41:53Z
Lists: pgsql-hackers
On Fri, Aug 15, 2025 at 03:22:18AM +0000, Hayato Kuroda (Fujitsu) wrote: >> Based on this, I think we should remove the HASH_DEBUG support. >> It's been broken for six of the last nine years and only one >> person ever noticed. Moreover, if you were trying to find a >> problem in dynahash, you'd probably want different debug logging >> than what's here. > > I didn't realize that it has been broken for a long time. Agreed to remove > the HASH_DEBUG option. One use case where I've been recently relying on dynahash is the pgstats shmem code. While I've not used these symbols, I'm pretty sure that they could prove useful now that I know about them. Andres, an opinion perhaps? > I have never used both options, but one point is that hash_stats() has been > exported and extensions have called it. Is there a possibility that hidden > developer is using? > > Anyway, I have no strong opinion. Attached patch does 1) remove HASH_DEBUG and > 2) fix broken code with HASH_STATISTICS. It looks like I'm responsible for breaking one of them, at least, sorry for that. As far as I can see, the fixes are not complicated, so I'd rather fix and backpatch things rather than removing both as both combined can be quite powerful when debugging or improving this code. David, were you planning to do so? I'd vote for keeping these working. -- Michael
Commits
-
Remove HASH_DEBUG output from dynahash.c
- a98ccf727ebb 19 (unreleased) landed
-
Use elog(DEBUG4) for dynahash.c statistics output
- 05fcb9667c37 19 (unreleased) landed
-
Fix invalid format string in HASH_DEBUG code
- 2c7c08a090f2 14.20 landed
- 199a347d29e5 15.15 landed
- d809494cdfc5 16.11 landed
- 04b384b3efb2 17.7 landed
- 1571c7ca5dc9 18.0 landed
- 296cba276081 19 (unreleased) landed
-
Fix failing -D HASH_STATISTICS builds
- efe705b05cc1 17.7 landed
- e4ba326295c5 18.0 landed
- ca38912512a9 19 (unreleased) landed
-
Refactor initial hash lookup in dynahash.c
- cc5ef90edd80 17.0 cited
-
Remove large fill factor support from dynahash.c.
- be0a6666656e 14.0 cited
-
Remove broken and useless entry-count printing in HASH_DEBUG code.
- 9d4e56699957 10.0 cited
-
Partition the freelist for shared dynahash tables.
- 44ca4022f3f9 9.6.0 cited