Re: TOAST & vacuum

From: JanWieck(at)t-online(dot)de (Jan Wieck)
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jan Wieck <JanWieck(at)Yahoo(dot)com>, PostgreSQL HACKERS <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TOAST & vacuum
Date: 2000-07-22 09:28:25
Message-ID: 200007220928.LAA08420@hot.jw.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> JanWieck(at)t-online(dot)de (Jan Wieck) writes:
> > TOAST is now vacuum-safe. When needed, the toaster creates a
> > second heap tuple, containing only plain or compressed
> > values. This one is then returned by the heap access methods
> > to the caller, so indices will never contain external
> > references.
>
> That should be sufficient for insertions into existing indexes,
> but what about CREATE INDEX on a column that already contains
> toasted values? That works with fetched tuples, not ones formed
> during insert/update.
>
> I think a cleaner and more reliable short-term hack would be to twiddle
> index_formtuple() to detoast any externally-stored attributes. AFAIK,
> in current sources all paths for creating an index tuple go through that
> routine, and it has a tupdesc handy so it knows which attributes are of
> varlena type.
>
> This way you wouldn't need to hack up the tuptoaster itself.

You're right. Will do it that way.

> Also, this would work for functional indexes whereas the way you are
> doing it will not (a function could return a toasted Datum extracted
> from some other table, no?).

Don't know of a function that does it that way right now. But
that doesn't mean no such exists - you're right again. 2
donut's for U.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2000-07-22 11:20:32 Re: Vaccuum allows read access?
Previous Message Peter Eisentraut 2000-07-22 01:47:57 Re: pg_dump, libdump, dump API, & backend again