Thread: pgsql: Improve the way in which CatalogCacheComputeHashValue combines

pgsql: Improve the way in which CatalogCacheComputeHashValue combines

From
tgl@postgresql.org (Tom Lane)
Date:
Log Message:
-----------
Improve the way in which CatalogCacheComputeHashValue combines multiple key
values: don't throw away perfectly good hash bits, and increase the shift
distances so as to provide more separation in the common case where some of
the key values are small integers (and so their hashes are too, because
hashfunc.c doesn't try all that hard).  This reduces the runtime of
SearchCatCache by a factor of 4 in an example provided by Greg Stark,
in which the planner spends a whole lot of time searching the two-key
STATRELATT cache.  It seems unlikely to hurt in other cases, but maybe
we could do even better?

Modified Files:
--------------
    pgsql/src/backend/utils/cache:
        catcache.c (r1.136 -> r1.137)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/catcache.c.diff?r1=1.136&r2=1.137)