[Engine-devel] short research on postgresql enums
Itamar Heim
iheim at redhat.com
Sat Dec 10 19:23:06 UTC 2011
On 12/10/2011 09:02 PM, Eli Mesika wrote:
>
>
> ----- Original Message -----
>> From: "Laszlo Hornyak"<lhornyak at redhat.com>
>> To: engine-devel at ovirt.org
>> Sent: Friday, December 9, 2011 10:43:43 PM
>> Subject: [Engine-devel] short research on postgresql enums
>>
>> Hi,
>>
>> I looked into Mike's database patch (
>> http://gerrit.ovirt.org/#change,500 ) today and read Yaniv's comment
>> on it. I have seen another patches related to enums and how they are
>> stored in the database. I made a quick test to compare between
>> varchar and enum and the results are here:
>> http://dummywarhead.blogspot.com/2011/12/postgresql-enums-vs-varchar.html
>>
>> IMO enums could be a good solution, but changing enums could be a
>> pain under postgres 9.1. So what if we could use varchar now and
>> migrate to enum once postgres 9.1 replaces the older installations
>> :)
>>
> +1
several considerations:
1. for existing enums - their numbering is part of the "api" (for
example, audit log even id.
2. they are also part of the "api" of the data warehouse.
3. space is a critical difference when you think of the data warehouse
rather than on the operational db. that alone is reason enough to have
these as numeric.
4. we need to provide i18n - not sure if this will be easier in numeric
or string form.
5. if 9.1 will support enums, and currently all enums are stored as
numeric - why not keep it consistent until moving to 9.1?
however, worth remembering the fact a platform component brings a shiny
new feature is not always a reason to try it before it matures a bit:
a. it may be buggy (though it is fair to try and help it mature as well).
b. it may not be available in the various distributions yet, making it
harder to consume the code.
More information about the Devel
mailing list