]> granicus.if.org Git - postgresql/commit
Improve dynahash.c's API so that caller can specify the comparison function
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 19 Aug 2003 01:13:41 +0000 (01:13 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 19 Aug 2003 01:13:41 +0000 (01:13 +0000)
commit80860c32d92fe3445dcb7de70091354c9d0406b0
tree2119ed51447a2c45fc75dab13e8ec89115a9890a
parent23e10843db588928e18bd58018c2e70f4548f177
Improve dynahash.c's API so that caller can specify the comparison function
as well as the hash function (formerly the comparison function was hardwired
as memcmp()).  This makes it possible to eliminate the special-purpose
hashtable management code in execGrouping.c in favor of using dynahash to
manage tuple hashtables; which is a win because dynahash knows how to expand
a hashtable when the original size estimate was too small, whereas the
special-purpose code was too stupid to do that.  (See recent gripe from
Stephan Szabo about poor performance when hash table size estimate is way
off.)  Free side benefit: when using string_hash, the default comparison
function is now strncmp() instead of memcmp().  This should eliminate some
part of the overhead associated with larger NAMEDATALEN values.
src/backend/executor/execGrouping.c
src/backend/executor/nodeAgg.c
src/backend/executor/nodeSubplan.c
src/backend/utils/hash/dynahash.c
src/backend/utils/hash/hashfn.c
src/include/executor/executor.h
src/include/nodes/execnodes.h
src/include/utils/hsearch.h
src/test/regress/expected/polymorphism.out