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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Leonardo Francalanci" <lfrancalanci(at)simtel(dot)ie>
Cc: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: R: space taken by a row & compressed data
Date: 2004-08-26 16:23:50
Message-ID: 23416.1093537430@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Leonardo Francalanci" <lfrancalanci(at)simtel(dot)ie> writes:
> we have a system that stores 200,000,000 rows per month
> (other tables store 10,000,000 rows per month)
> Every row has 400 columns of integers + 2 columns (date+integer) as index.

> Our system compresses rows before writing them to a binary file on disk.
> Data don't usually need to be updated/removed.
> We usually access all columns of a row (hence compression on a per-row basis
> makes sense).

> Is there any way to compress data on a per-row basis? Maybe with
> a User-Defined type?

If you just stuck all the integers into a single integer-array column,
it would be 1600 bytes wide, which is ... hmm ... not quite wide enough
to trigger the toast logic. Perhaps it would be worthwhile for you to
run a custom build with TOAST_TUPLE_THRESHOLD/TOAST_TUPLE_TARGET set
to half their standard values (see src/include/access/tuptoaster.h).
You'd not need to write any specialized code that way.

Note that if you sometimes search on the values of one of the non-index
columns, this might be a bad idea.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-08-26 16:34:29 Re: R: space taken by a row & compressed data
Previous Message Bruce Momjian 2004-08-26 16:08:43 Re: R: space taken by a row & compressed data