Re: speedup tidbitmap patch: hash BlockNumber - Mailing list pgsql-hackers

From Tom Lane
Subject Re: speedup tidbitmap patch: hash BlockNumber
Date
Msg-id 22082.1418655665@sss.pgh.pa.us
Whole thread Raw
In response to Re: speedup tidbitmap patch: hash BlockNumber  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: speedup tidbitmap patch: hash BlockNumber  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> On 10/22/2014 04:14 PM, Teodor Sigaev wrote:
>> Just replace tag_hash in tidbitmap which uses hash_any to direct call of
>> hash_uint32, it saves ~5% of execution time.

> I'd suggest putting the new function in hashfn.c, where we already have 
> similar functions, string_hash, tag_hash, oid_hash and bitmap_hash. And 
> name it "blocknumber_hash", for consistency.

I think this suggestion is misguided, and the patch itself needs
rethinking.  Instead of doing this, let's hack dynahash.c itself
to substitute a shim like this when it's told function == tag_hash and
keysize == sizeof(uint32).  Then we can remove any similar shims that
already exist, and possibly end up with a net savings of code rather than
adding more.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Minor binary-search int overflow in timezone code
Next
From: Tom Lane
Date:
Subject: Something is broken in logical decoding with CLOBBER_CACHE_ALWAYS