Unix Technical Forum

Re: vacuum, performance, and MVCC

This is a discussion on Re: vacuum, performance, and MVCC within the pgsql Hackers forums, part of the PostgreSQL category; --> bruce wrote: > Why three? I explained using only two heap tuples: > > [item1]...[tuple1] > > becomes on ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 03:11 AM
Bruce Momjian
 
Posts: n/a
Default Re: vacuum, performance, and MVCC

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 visible tuple 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. +

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:28 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com