Re: extensible enum types

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: extensible enum types
Дата
Msg-id 4C1D1373.5020103@dunslane.net
обсуждение исходный текст
Ответ на Re: extensible enum types  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: extensible enum types  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>   
>> Tom Lane wrote:
>>     
>>> Insert a sort order column into pg_enum, and rearrange the values in
>>> that whenever the user wants to add a new value in a particular place.
>>> You give up cheap comparisons in exchange for flexibility.  I think lots
>>> of people would accept that tradeoff, especially if they could make it
>>> per-datatype.
>>>       
>
>   
>> But I'm not happy about giving up cheap comparison.
>>     
>
> I don't think it would be all that bad.  We could teach typcache.c to
> cache the ordering data for any type that's in active use.  It'd
> certainly be a lot more expensive than OID comparison, but perhaps not
> worse than NUMERIC comparisons.
>
>   
>   

Another thought: could we add a column to pg_type with a flag that's 
true if the oids are in sort order? Then the comparison routines could 
just look that up in the type cache and if it's true (as it often will 
be) just return the oid comparison.

cheers

andrew


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: beta3 & the open items list
Следующее
От: Tom Lane
Дата:
Сообщение: Re: extensible enum types