Re: How can fixed and variable width columns perform similarly?

От: Tom Lane
Тема: Re: How can fixed and variable width columns perform similarly?
Дата: ,
Msg-id: 16453.1177693967@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Re: How can fixed and variable width columns perform similarly?  ("Siddharth Anand")
Список: pgsql-performance

Скрыть дерево обсуждения

How can fixed and variable width columns perform similarly?  ("Siddharth Anand", )
 Re: How can fixed and variable width columns perform similarly?  (Tom Lane, )
  Re: How can fixed and variable width columns perform similarly?  ("Siddharth Anand", )
   Re: How can fixed and variable width columns perform similarly?  (Tom Lane, )
 Re: How can fixed and variable width columns perform similarly?  ("Dave Dutcher", )

"Siddharth Anand" <> writes:
> My question wasn't phrased clearly. Oracle exhibits a performance
> degradation for very large-sized fields (CLOB types that I equate to
> PostGres' text type) when compared with the performance of field types
> like varchar that handle a max character limit of a few thousand bytes in
> Oracle.

> It sounds like PostGres doesn't exhibit this same difference. I wanted to
> understand how this could be and whether there was a trade-off.

Ah.  Well, the answer is that we change behavior dynamically depending
on the size of the particular field value, instead of hard-wiring it to
the declared column type.  It sounds like Oracle's CLOB might be doing
about the same thing as an out-of-line "toasted" field value in
Postgres.  In PG, text and varchar behave identically except that
varchar(N) adds an insert-time check on the length of the field value
--- but this is just a constraint check and doesn't have any direct
influence on how the value is stored.

            regards, tom lane


В списке pgsql-performance по дате сообщения:

От: Tom Lane
Дата:
Сообщение: Re: Very specific server situation
От: Josh Berkus
Дата:
Сообщение: Re: Feature Request --- was: PostgreSQL Performance Tuning