Re: AW: update on TOAST status'

Jan Wieck <janwieck@t-online.de>

From: JanWieck@t-online.de (Jan Wieck)
To: PostgreSQL HACKERS <pgsql-hackers@postgresql.org>
Date: 2000-07-11T16:49:58Z
Lists: pgsql-hackers
Zeugswetter Andreas SB wrote:
>
> >     It appears that brtee indices (at least) can keep  references
> >     to  old  toast  values  that  survive  a  VACUUM! Seems these
> >     references live in nodes actually not  referring  to  a  heap
> >     tuple   any   more,   but   used  during  tree  traversal  in
> >     comparisions.  As if an index tuple delete from a  btree  not
> >     necessarily  causes  the  index  value  to disappear from the
> >     btree completely.  It'll never be returned by an index  scan,
> >     but the value is still there somewhere.
>
> Would it be possible to actually delete those entries during vacuum ?
> I guess that would be an overall win, no ?

    Seems  I explained it a little confusing or am confused by it
    myself.

    Either way, VACUUM does DELETE those from  the  indices!  But
    btree  is a Balanced Tree, and ISTM that it sometimes decides
    to keep a deleted node just to have  trees  balanced  and  to
    decide  on it whether to go left or right. An index scan will
    never return those nodes, but exactly at the time btree needs
    to decide left/right, it calls the type specific CMP function
    and that in turn invokes the toast fetch.

    A pure btree does not have the need for it, but we're using a
    high  concurrency  optimized  version called nbtree. That one
    seems to do so.


Jan

--

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