Re: WIP: extensible enums

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Greg Stark <gsstark(at)mit(dot)edu>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: extensible enums
Date: 2010-11-12 18:40:28
Message-ID: 201011121840.oACIeS820559@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > On 10/24/2010 08:12 PM, Tom Lane wrote:
> >> This shows that the bitmapset optimization really is quite effective,
> >> at least for cases where all the enum labels are sorted by OID after
> >> all. That motivated me to change the bitmapset setup code to what's
> >> attached. This is potentially a little slower at initializing the
> >> cache, but it makes up for that by still marking most enum members
> >> as sorted even when a few out-of-order members have been inserted.
>
> > That's nice. It's a tradeoff though. Bumping up the cost of setting up
> > the cache won't have much effect on a creating a large index, but could
> > affect to performance of retail comparisons significantly. But this is
> > probably worth it. You'd have to work hard to create the perverse case
> > that could result in seriously worse cache setup cost.
>
> Well, notice that I moved the caching into typcache.c, rather than
> having it be associated with query startup. So unless you're actively
> frobbing the enum definition, that's going to be paid only once per
> session.

FYI, I marked the TODO item for adding enums as completed. The TODO
item used to also mention renaming or removing enums, but I have seen
few requests for that so I removed that suggestion. We can always
re-add it if there is demand.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-11-12 18:50:00 Re: WIP: extensible enums
Previous Message Bruce Momjian 2010-11-12 18:36:46 Re: WIP: extensible enums