datatype advice numeric vs. varchar
От | Gene |
---|---|
Тема | datatype advice numeric vs. varchar |
Дата | |
Msg-id | 430d92a20701172215o4dbd644dh4418fb3346a85906@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: datatype advice numeric vs. varchar
Re: datatype advice numeric vs. varchar |
Список | pgsql-general |
I'm working on a voicemail application which involves storing phone numbers and other types that have long sequences of digits [0-9]. I need to be able to do pattern matching using LIKE and map the fields back to java String objects. I was thinking maybe it would be more efficient to use the numeric(x,0) type instead of a varchar since it could use less space on disk. My calculations for disk space based off some information i found online are ( 8 + ( 2 bytes for every four digits) ) for numeric and ( 4 + number of chars ) for a utf8 varchar datatype. Are these calculations still valid and has anyone tried using numeric for this purpose or is this really stupid? Thanks for any hints! Gene
В списке pgsql-general по дате отправления: