Re: vacuum, performance, and MVCC - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: vacuum, performance, and MVCC
Date
Msg-id 200606260129.k5Q1TVf03655@momjian.us
Whole thread Raw
In response to vacuum, performance, and MVCC  ("Mark Woodward" <pgsql@mohawksoft.com>)
List pgsql-hackers
bruce wrote:
> Why three?  I explained using only two heap tuples:
> 
>     [item1]...[tuple1]
> 
> becomes on UPDATE:
>            ---------->
>     [item1]...[tuple1][tuple2]
>                       ----->
> 
> on another UPDATE, if tuple1 is no longer visible:
> 
>            ------------------>
>     [item1]...[tuple1][tuple2]
>                       <------
> 

Here is some pseudo-code that implements this:
 Definition:  Single-Index-Tuple Chain (CITC)
 Do old and new UPDATE rows have unchanged indexed columns?Is old row member of CITC?    Point item id at first CITC
visibletuple in chain    Mark previous invisible CITC tuples as freespace
 
Does page have free space?    Add new tuple on the same page as old    Mark old tuple as CITC    Do not create index
entries

VACUUM would have to be taught about CITC, and CREATE INDEX would have
to create entries in other indexes for cases where its new indexed
columns change inside a CITC.

Conceptually, CITC allows a single index entry to point to multiple
UPDATEd rows, allowing non-visible tuples to be recycled (and reused for
future UPDATEs) without affecting the index.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Table clustering idea
Next
From: Jan Wieck
Date:
Subject: Re: vacuum, performance, and MVCC