pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
MAIN vs. PLAIN
2+ messages / 2 participants
[nested] [flat]

* MAIN vs. PLAIN
@ 2005-03-04 20:59 Dave Held <dave.held@arrayservicesgrp.com>
  2005-03-05 04:33 ` Re: MAIN vs. PLAIN Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Dave Held @ 2005-03-04 20:59 UTC (permalink / raw)
  To: pgsql-performance

I notice that by default, postgres sets numeric fields to
storage MAIN.  What exactly does that mean?  Does that mean
it stores it in some type of compressed BCD format?  If so,
how much performance gain can I expect by setting the storage
to PLAIN?  Also, the docs say that char(n) is implemented more
or less the same way as text.  Does that mean that setting
a field to, say, char(2) PLAIN is not going be any faster
than text PLAIN?  That seems a bit counter-intuitive.  I
would hope that a char(2) PLAIN would just reserve two chars
in the record structure without any overhead of pointers to
external data.  Is there a reason this isn't supported?

__
David B. Held
Software Engineer/Array Services Group
200 14th Ave. East,  Sartell, MN 56377
320.534.3637 320.253.7800 800.752.8129



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: MAIN vs. PLAIN
  2005-03-04 20:59 MAIN vs. PLAIN Dave Held <dave.held@arrayservicesgrp.com>
@ 2005-03-05 04:33 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2005-03-05 04:33 UTC (permalink / raw)
  To: Dave Held <dave.held@arrayservicesgrp.com>; +Cc: pgsql-performance

"Dave Held" <dave.held@arrayservicesgrp.com> writes:
> I notice that by default, postgres sets numeric fields to
> storage MAIN.  What exactly does that mean?

See http://developer.postgresql.org/docs/postgres/storage-toast.html

There isn't any amazingly strong reason why numeric defaults to MAIN
rather than EXTENDED, which is the default for every other toastable
datatype --- except that I thought it'd be a good idea to have at
least one type that did so, just to exercise that code path in the
tuple toaster.  And numeric shouldn't ordinarily be large enough to
need out-of-line storage anyway.  It's unlikely even to need
compression, really, but as long as it's a varlena type the overhead
to support toasting is nearly nil.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-03-05 04:33 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-04 20:59 MAIN vs. PLAIN Dave Held <dave.held@arrayservicesgrp.com>
2005-03-05 04:33 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox