Re: WIP: extensible enums
От | Tom Lane |
---|---|
Тема | Re: WIP: extensible enums |
Дата | |
Msg-id | 3415.1287937222@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: WIP: extensible enums (Greg Stark <gsstark@mit.edu>) |
Ответы |
Re: WIP: extensible enums
Re: WIP: extensible enums |
Список | pgsql-hackers |
Greg Stark <gsstark@mit.edu> writes: > There's nothing magic about the integral types here. If you use a > string then you could always split by making the string longer. The entire objective here is to make enum comparisons fast. Somehow, going to a non-primitive data type to represent the sort values does not seem like a win from that perspective. (Likewise for Dean's suggestion for an array of another kind.) What I'm currently thinking is that we should actually use float4 not float8. That eliminates any concerns about making the representation larger than it was before. We'll definitely have to have the logic to do renumbering, but it'll still be an exceedingly rare thing in practice. With float4 the implementation would fail at somewhere around 2^24 elements in an enum (since even with renumbering, there wouldn't be enough bits to give each element a distinguishable value). I don't see that as a real objection, and anyway if you were trying to have an enum with many elements, you'd want the in-memory representation to be compact. regards, tom lane
В списке pgsql-hackers по дате отправления: