Remove HASH_DEBUG output from dynahash.c
authorDavid Rowley <drowley@postgresql.org>
Mon, 18 Aug 2025 23:14:21 +0000 (11:14 +1200)
committerDavid Rowley <drowley@postgresql.org>
Mon, 18 Aug 2025 23:14:21 +0000 (11:14 +1200)
This existed in a semi broken stated from be0a66666 until 296cba276.
Recent discussion has questioned the value of having this at all as it
only outputs static information from various of the hash table's
properties when the hash table is created.

Author: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/OSCPR01MB1496650D03FA0293AB9C21416F534A@OSCPR01MB14966.jpnprd01.prod.outlook.com

src/backend/utils/hash/dynahash.c

index 2b22c65e541d47b4237ee06488e7b2775f646f4d..a7094917c20ca91b4e18d04c8fdda6d89f261ec3 100644 (file)
@@ -80,9 +80,8 @@
  * are not implemented; otherwise functionality is identical.
  *
  * Compilation controls:
- * HASH_DEBUG controls some informative traces, mainly for debugging.
- * HASH_STATISTICS causes HashAccesses and HashCollisions to be maintained;
- * when combined with HASH_DEBUG, these are displayed by hdestroy().
+ * HASH_STATISTICS causes some usage statistics to be maintained, which can be
+ * logged by calling hash_stats().
  *
  * Problems & fixes to ejp@ausmelb.oz. WARNING: relies on pre-processor
  * concatenation property, in probably unnecessary code 'optimization'.
@@ -770,17 +769,6 @@ init_htab(HTAB *hashp, long nelem)
    /* Choose number of entries to allocate at a time */
    hctl->nelem_alloc = choose_nelem_alloc(hctl->entrysize);
 
-#ifdef HASH_DEBUG
-   fprintf(stderr, "init_htab:\n%s%p\n%s%ld\n%s%ld\n%s%d\n%s%u\n%s%x\n%s%x\n%s%ld\n",
-           "TABLE POINTER   ", hashp,
-           "DIRECTORY SIZE  ", hctl->dsize,
-           "SEGMENT SIZE    ", hctl->ssize,
-           "SEGMENT SHIFT   ", hctl->sshift,
-           "MAX BUCKET      ", hctl->max_bucket,
-           "HIGH MASK       ", hctl->high_mask,
-           "LOW  MASK       ", hctl->low_mask,
-           "NSEGS           ", hctl->nsegs);
-#endif
    return true;
 }