Re: Win2K Questions

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>, pgsql-general(at)postgresql(dot)org
Subject: Re: Win2K Questions
Date: 2002-11-12 05:09:27
Message-ID: 200211120509.gAC59S306689@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Jean-Luc Lachance wrote:
> >> The index has to be updated anyhow to reflect the new record. Doesn't
> >> it?
>
> > Actually no. Index scans can go from the index to the heap, see the
> > tuple is dead, and move on to the next one.
>
> More specifically: an UPDATE operation has to insert *new* index entries
> pointing at the new version of the row. It does not presently have to
> touch the index entries for the prior version of the row. Similarly,
> DELETE need not modify index entries at all. To maintain version status
> in index entries, both those operations would have to get slower.
> (The eventual cleanup of the dead index entries is handled by VACUUM,
> which we hope is not critical to interactive performance.)
>

Also, consider how hard it is to find the index entries matching a given
heap row being updated. Being able to skip that step is a big win for
UPDATE and DELETE. The nice thing is that it is updated later when
someone accesses it.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar 2002-11-12 06:35:05 Re: C++: get value for integral types?
Previous Message Tom Lane 2002-11-12 05:06:35 Re: Win2K Questions