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

From jian he
Subject Re: Do we want a hashset type?
Date
Msg-id CACJufxFMHZXdZtgt621QdO=h9fz778nAahgMvSMxepSCwp8aqQ@mail.gmail.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?
List pgsql-hackers
> Or maybe I just don't understand the proposal. Perhaps it'd be best if
> jian wrote a patch illustrating the idea, and showing how it performs
> compared to the current approach.

currently joel's idea is a int4hashset. based on the code first tomas wrote.
it looks like a non-nested an collection of unique int4. external text format looks like {int4, int4,int4}
structure looks like (header +  capacity slots * int4).
Within the capacity slots, some slots are empty, some have unique values.

The textual int4hashset looks like a one dimensional array.
so I copied/imitated src/backend/utils/adt/arrayfuncs.c code, rewrote a slight generic hashset input and output function.

see the attached c file.
It works fine for non-null input output for {int4hashset, int8hashset, timestamphashset,intervalhashset,uuidhashset).
Attachment

pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Speeding Up Bitmapset
Next
From: Ahmed Ibrahim
Date:
Subject: Re: Inquiry/Help with pg_adviser (problem in index_create function for creating indexes)