OidIsValid(node->skewTable),
&nbuckets, &nbatch, &num_skew_mcvs);
-#ifdef HJDEBUG
- printf("nbatch = %d, nbuckets = %d\n", nbatch, nbuckets);
-#endif
-
/* nbuckets must be a power of 2 */
log2_nbuckets = my_log2(nbuckets);
Assert(nbuckets == (1 << log2_nbuckets));
hashtable->spaceAllowed * SKEW_WORK_MEM_PERCENT / 100;
hashtable->chunks = NULL;
+#ifdef HJDEBUG
+ printf("Hashjoin %p: initial nbatch = %d, nbuckets = %d\n",
+ hashtable, nbatch, nbuckets);
+#endif
+
/*
* Get info about the hash functions to be used for each hash key. Also
* remember whether the join operators are strict.
Assert(nbatch > 1);
#ifdef HJDEBUG
- printf("Increasing nbatch to %d because space = %lu\n",
- nbatch, (unsigned long) hashtable->spaceUsed);
+ printf("Hashjoin %p: increasing nbatch to %d because space = %zu\n",
+ hashtable, nbatch, hashtable->spaceUsed);
#endif
oldcxt = MemoryContextSwitchTo(hashtable->hashCxt);
}
#ifdef HJDEBUG
- printf("Freed %ld of %ld tuples, space now %lu\n",
- nfreed, ninmemory, (unsigned long) hashtable->spaceUsed);
+ printf("Hashjoin %p: freed %ld of %ld tuples, space now %zu\n",
+ hashtable, nfreed, ninmemory, hashtable->spaceUsed);
#endif
/*
{
hashtable->growEnabled = false;
#ifdef HJDEBUG
- printf("Disabling further increase of nbatch\n");
+ printf("Hashjoin %p: disabling further increase of nbatch\n",
+ hashtable);
#endif
}
}
return;
#ifdef HJDEBUG
- printf("Increasing nbuckets %d => %d\n",
- hashtable->nbuckets, hashtable->nbuckets_optimal);
+ printf("Hashjoin %p: increasing nbuckets %d => %d\n",
+ hashtable, hashtable->nbuckets, hashtable->nbuckets_optimal);
#endif
hashtable->nbuckets = hashtable->nbuckets_optimal;
HJTUPLE_MINTUPLE(hashTuple)->t_len);
}
}
-
-#ifdef HJDEBUG
- printf("Nbuckets increased to %d, average items per bucket %.1f\n",
- hashtable->nbuckets, batchTuples / hashtable->nbuckets);
-#endif
}