Re: fixed-length row

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: fixed-length row
Date: 2004-01-25 00:54:08
Message-ID: 200401250054.i0P0s8n09515@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton wrote:
> On Thursday 15 January 2004 14:17, David Garamond wrote:
> > The MySQL manual recommends that we create a "fixed-length row" if
> > possible, for speed (especially scanning speed). A fixed-length row is a
> > row which is comprised of only fixed-length fields. A fixed-length field
> > takes a fixed amount of bytes for storage (e.g. INT = 4 bytes, CHAR(M) =
> > M bytes, etc).
> >
> > Is there a similar recommendation in PostgreSQL? I notice that most data
> > types are stored in variable-length mode anyway (is cidr and inet data
> > types fixed-length?)
>
> Not really - there have been various discussions about timing differences
> between char() and varchar() and I don't recall one being noticably faster
> than the others.
>
> > Is there a command/query in psql which can show storage requirement for
> > each field? For example:
>
> No, but there's stuff in the archives, and I think something on techdocs too.

FAQ item 4.14 covers this, and reports CHAR() and VARCHAR() have the
same performance characteristics.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message NTPT 2004-01-25 01:09:02 Re: Touch row ?
Previous Message Bruce Momjian 2004-01-25 00:38:35 Re: Mailing list? was Postgress and MYSQL