Skip site navigation (1) Skip section navigation (2)

Re: R: R: space taken by a row & compressed data

From: Joe Conway <mail(at)joeconway(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: R: R: space taken by a row & compressed data
Date: 2004-08-26 20:33:53
Message-ID: 412E4931.4010705@joeconway.com (view raw or flat)
Thread:
Lists: 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

In response to

pgsql-general by date

Next:From: Jan WieckDate: 2004-08-26 20:45:32
Subject: Re: R: R: space taken by a row & compressed data
Previous:From: Jan WieckDate: 2004-08-26 20:24:01
Subject: Re: Possible to insert quoted null value into integer field?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group