Re: move hash_any to utils/hash/hashfn.c

From: Andres Freund <andres(at)anarazel(dot)de>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: move hash_any to utils/hash/hashfn.c
Date: 2019-01-25 19:54:55
Message-ID: 20190125195455.yols67bv7lhekuon@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-01-25 20:05:37 Re: move hash_any to utils/hash/hashfn.c
Previous Message Alvaro Herrera 2019-01-25 19:35:18 move hash_any to utils/hash/hashfn.c