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

Re: Modifying TOAST thresholds

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Modifying TOAST thresholds
Date: 2007-04-03 01:02:17
Message-ID: 200704030102.l3312HS08735@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom, are you going to do this for 8.3?

---------------------------------------------------------------------------

Tom Lane wrote:
> In another thread I wrote:
> > ... One thing I was just thinking about is that it's silly to have
> > the threshold constrained so strongly by a desire that tuples in toast
> > tables not be toastable.  It would be trivial to tweak the heapam.c
> > routines so that they simply don't invoke the toaster when relkind is
> > 't', and then we could have independent choices of toast-tuple size and
> > main-tuple size.  This would be particularly good because in the current
> > scheme you can't modify toast-tuple size without an initdb, but if that
> > were decoupled there'd be no reason not to allow changes in the
> > main-tuple thresholds.
> 
> After thinking about this more I'm convinced that the above is a good
> idea, eg in heap_insert change
> 
>     if (HeapTupleHasExternal(tup) || tup->t_len > TOAST_TUPLE_THRESHOLD)
>         heaptup = toast_insert_or_update(relation, tup, NULL, use_wal);
>     else
>         heaptup = tup;
> 
> to
> 
>     if (relation->rd_rel->relkind == RELKIND_TOASTVALUE)
>     {
>         /* toast table entries should never be recursively toasted */
>         Assert(!HeapTupleHasExternal(tup));
>         heaptup = tup;
>     }
>     else if (HeapTupleHasExternal(tup) || tup->t_len > TOAST_TUPLE_THRESHOLD)
>         heaptup = toast_insert_or_update(relation, tup, NULL, use_wal);
>     else
>         heaptup = tup;
> 
> I also think that we ought to add TOAST_MAX_CHUNK_SIZE to the set of
> compiled-in parameters that are recorded in pg_control and checked for
> compatibility at startup (like BLCKSZ) --- this will prevent anyone from
> shooting themselves in the foot while experimenting.
> 
> Any objections?
> 
>             regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2007-04-03 01:04:14
Subject: Re: Modifying TOAST thresholdsf
Previous:From: Andrew - SupernewsDate: 2007-04-03 00:58:32
Subject: Re: Bug in UTF8-Validation Code?

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