From: | jian he <jian(dot)universality(at)gmail(dot)com> |
---|---|
To: | Joel Jacobson <joel(at)compiler(dot)org> |
Cc: | Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Tom Dunstan <pgsql(at)tomd(dot)cc>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: Do we want a hashset type? |
Date: | 2023-06-25 13:32:08 |
Message-ID: | CACJufxFMHZXdZtgt621QdO=h9fz778nAahgMvSMxepSCwp8aqQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 | Content-Type | Size |
---|---|---|
set.c | text/x-c-code | 36.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Ahmed Ibrahim | 2023-06-25 14:30:37 | Re: Inquiry/Help with pg_adviser (problem in index_create function for creating indexes) |
Previous Message | Ranier Vilela | 2023-06-25 12:28:36 | Speeding Up Bitmapset |