Re: move hash_any to utils/hash/hashfn.c - Mailing list pgsql-hackers

From Andres Freund
Subject Re: move hash_any to utils/hash/hashfn.c
Date
Msg-id 20190125195455.yols67bv7lhekuon@alap3.anarazel.de
Whole thread Raw
In response to move hash_any to utils/hash/hashfn.c  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: move hash_any to utils/hash/hashfn.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: move hash_any to utils/hash/hashfn.c  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Hi,

On 2019-01-25 16:35:18 -0300, Alvaro Herrera wrote:
> I just noticed (once again) that we have hash_any() declared in
> src/access/hash.h (the header file for the hash index AM) rather than
> somewhere in utils/, for no good reason other than perhaps there was no
> better place when it was introduced.  This means that some files that
> seem to just need hash_any end up pointlessly #including the whole AM
> world upon themselves.
> 
> Would anybody object too hard if I move hash_any() and friends to
> src/backend/utils/hash/hashfn.c and the declarations to
> src/include/utils/hashutils.h?

I hate the current split quite a bit, albeit for somewhat different
reasons. We make things like tag_hash, uint32_hash unnecessarily more
expensive by adding an entirely useless external function call. And
some of these can be fairly hot (e.g. for syscache).  So yea, let's
move this stuff together.

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: move hash_any to utils/hash/hashfn.c
Next
From: Tom Lane
Date:
Subject: Re: move hash_any to utils/hash/hashfn.c