Re: R: R: space taken by a row & compressed data - Mailing list pgsql-general

From Joe Conway
Subject Re: R: R: space taken by a row & compressed data
Date
Msg-id 412E4931.4010705@joeconway.com
Whole thread Raw
In response to Re: R: R: space taken by a row & compressed data  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
Greg Stark wrote:
> Are toasted values stored in the table itself or in a separate table?

In a separate table if they exceed a threshold.

> My understanding was that it was the latter, which leads me to wonder whether
> he'll actually gain anything by having all the records in his table be
> toasted. It'll mean every record lookup has to traverse two indexes, and a
> sequential scan loses the sequential read performance boost.
>
> Or am I wrong and toasted values can be stored inline?
>

They can be, but are not by default. See:
   http://www.postgresql.org/docs/current/static/sql-altertable.html

SET STORAGE

     This form sets the storage mode for a column. This controls whether
this column is held inline or in a supplementary table, and whether the
data should be compressed or not. PLAIN must be used for fixed-length
values such as integer and is inline, uncompressed. MAIN is for inline,
compressible data. EXTERNAL is for external, uncompressed data, and
EXTENDED is for external, compressed data. EXTENDED is the default for
all data types that support it. The use of EXTERNAL will, for example,
make substring operations on a text column faster, at the penalty of
increased storage space.


Joe

pgsql-general by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Possible to insert quoted null value into integer field?
Next
From: Jan Wieck
Date:
Subject: Re: R: R: space taken by a row & compressed data