Re: extensible enum types - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: extensible enum types
Date
Msg-id AANLkTikGvSO81dbMWIACBJzt2qa2AgkKZhgZigXMe4zc@mail.gmail.com
Whole thread Raw
In response to Re: extensible enum types  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Sat, Jun 19, 2010 at 4:55 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
> Gurjeet Singh wrote:
>>
>>
>> This is very similar to Andrew's original suggestion of splitting 32 bits
>> into 16+16, but managed by the machine hence no complicated comparison algos
>> needed on our part. Also, since this is all transparent to the SQL
>> interface, our dump-reload cycle or Slony replication, etc. should not be
>> affected either.
>>
>>
>
> It would break the on-disk representation, though. That's not something we
> want to do any more if it can possibly be avoided. We want to keep
> pg_upgrade working.

I was partial to your original idea -- i thought it was quite clever
actually.  enums are a performance side of a tradeoff already so I
think any improvement for them should be looked at through that lens.

16 bits is IMO enough to pick a reasonable bucket size that gives you
enough play to handle the vast majority of cases that are appropriate
for enums.  your workaround in the rare case you actually hit the
limitations (most of these would fall under the 'oops, i used the
wrong tool' category) seems perfectly ok imo.

merlin


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: extensible enum types
Next
From: "Joshua D. Drake"
Date:
Subject: Re: beta3 & the open items list