Re: Datatypes and performance

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Datatypes and performance
Дата
Msg-id 20030704202416.GB5679@libertyrms.info
обсуждение исходный текст
Ответ на Re: Datatypes and performance  ("Maksim Likharev" <mlikharev@aurigin.com>)
Список pgsql-general
On Fri, Jul 04, 2003 at 01:14:52PM -0700, Maksim Likharev wrote:
> How postgres internally stores text fields, in a separate table?

I believe it gets stored in a separate table just in case it's too
long (read the docs on TOAST if you want more about this).  But
normally, no.  Here's what the docs have to say about it:

---cut here---
The storage requirement for data of these types is 4 bytes plus the
actual string, and in case of character plus the padding. Long
strings are compressed by the system automatically, so the physical
requirement on disk may be less. Long values are also stored in
background tables so they don't interfere with rapid access to the
shorter column values. In any case, the longest possible character
string that can be stored is about 1 GB. (The maximum value that will
be allowed for n in the data type declaration is less than that. It
wouldn't be very useful to change this because with multibyte
character encodings the number of characters and bytes can be quite
different anyway. If you desire to store long strings with no
specific upper limit, use text or character varying without a length
specifier, rather than making up an arbitrary length limit.)
---cut here---

A
--
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110


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

Предыдущее
От: "Maksim Likharev"
Дата:
Сообщение: Re: Datatypes and performance
Следующее
От: "Maksim Likharev"
Дата:
Сообщение: Re: Datatypes and performance