Re: bytea and text

Поиск
Список
Период
Сортировка
От Jean-Yves F. Barbier
Тема Re: bytea and text
Дата
Msg-id 4B0EA8EF.3050500@gmail.com
обсуждение исходный текст
Ответ на Re: bytea and text  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Tom Lane a écrit :
> "Jean-Yves F. Barbier" <12ukwn@gmail.com> writes:
>> I'm asking myself what solution for storing pictures is the best:
>
>> * using a BYTEA column type, and having no intrinsic compression gain
>>    because a picture it almost every time already compressed,
>
>> * using a TEXT column type, and store a Base64(picture) in it; it should
>>    take benefits of intrinsic compression (?).
>
> At best, the compression would get rid of the overhead you added by
> converting to base64.  It probably wouldn't completely succeed at that,
> though, meaning the second alternative is always a loser.
>
>             regards, tom lane

Yeah I saw that in a simple test: zipping a Base64 file from a picture
(I guess the LZ algo's the same from zip to PG) only crunch it by 25%,
which make the result always bigger than a BYTEA.

Thanks
--
Doubt isn't the opposite of faith; it is an element of faith.
        -- Paul Tillich, German theologian and historian

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: bytea and text
Следующее
От: "Jean-Yves F. Barbier"
Дата:
Сообщение: index speed-up and automatic tables/procedures creation