Re: 7.2.3: tuple is too big (max 8136)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: pilsl(at)goldfisch(dot)at, Doug McNaught <doug(at)mcnaught(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: 7.2.3: tuple is too big (max 8136)
Date: 2002-11-04 02:19:54
Message-ID: 25508.1036376394@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> writes:
> Technically there is still a tuple size limit. It's just that many types
> can be pulled out of the main storage of the table and you get a reference
> to its value in the main storage rather than the value itself. That's how
> the 8k limit was circumvented. The tuple size limit is part of why
> there's a maximum column count, AFAIK the main tuple still needs to fit in
> one page.

Right. You could fit 1600 int4 columns (6400 bytes total), but not 1600
int8 columns. TOAST pointer entries are 20 bytes each, so if all your
columns are toastable types (like varchar) then the upper limit would be
about 400 columns.

In practice, performance will probably suck with more than a couple
hundred columns anyway. You'd be better off rethinking your database
design.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Nuzum 2002-11-04 02:25:58 quoting and EXECUTE in plpgsql function
Previous Message Justin Clift 2002-11-04 02:16:23 Spanish version of the PostgreSQL "Advocacy and Marketing" site is ready

Browse pgsql-sql by date

  From Date Subject
Next Message Neil Conway 2002-11-04 04:08:17 Re: Does this matter?
Previous Message Stephan Szabo 2002-11-04 00:38:45 Re: 7.2.3: tuple is too big (max 8136)