Re: Do we want a hashset type? - Mailing list pgsql-hackers

From Joel Jacobson
Subject Re: Do we want a hashset type?
Date
Msg-id 605bfc3d-9e67-46d2-ab06-8e3459e62e25@app.fastmail.com
Whole thread Raw
In response to Re: Do we want a hashset type?  ("Joel Jacobson" <joel@compiler.org>)
Responses Re: Do we want a hashset type?  ("Joel Jacobson" <joel@compiler.org>)
List pgsql-hackers
On Mon, Jun 12, 2023, at 22:36, Joel Jacobson wrote:
> On Mon, Jun 12, 2023, at 21:58, Tomas Vondra wrote:
>> My suggestion is to be lazy, just use the lookup3 we have in hashfn.c
>> (through hash_bytes or something), and at the same time make it possible
>> to switch to a different function in the future. I'd store and ID of the
>> hash function in the set, so that we can support a different algorithm
>> in the future, if we choose to.

hashset is now using hash_bytes_uint32() from hashfn.h

Other changes in the same commit:

* Introduce hashfn_id field to specify hash function ID
* Implement hashset_send and hashset_recv and add C-test using libpq
* Add operators and operator classes for hashset comparison, sorting
  and distinct queries

Looks good? If so, I wonder what's best to focus on next?
Perhaps adding support for bigint? Other ideas?

/Joel
Attachment

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: [PATCH] Slight improvement of worker_spi.c example
Next
From: Magnus Hagander
Date:
Subject: Re: Add wait event for log emission?