Skip site navigation (1) Skip section navigation (2)

Question: Can i cut NON-HOT chain Pointers if there are no concurrent updates?

From: "Henning Mälzer" <HMaelzer(at)buerotiger(dot)de>
To: pgsql-cluster-hackers(at)postgresql(dot)org
Subject: Question: Can i cut NON-HOT chain Pointers if there are no concurrent updates?
Date: 2012-11-23 14:17:59
Message-ID: 20121123141759.121640@gmx.net (view raw or flat)
Thread:
Lists: pgsql-cluster-hackerspgsql-hackers
Hello,

Can somebody help me?

I am trying to answer a question to implement a new concept in postgresql.
What i do is some sort of reorganizing heapfiles where the whole concept would be to much for this mail. So i try to describe just the problem.

Question:
What would be the loss if i cut NON-HOT chain Pointers, meaning i set t_ctid=t_self in the case where it points to a tuple on another page?

The Tuples can be found over the index, because NON-HOT Tuple versions have their own index entry.
index_getnext does not follow these pointers.
They would also be found by heap_getnext.

Whithin updated tuples there is also xmax set, so later transactions would recognize it as deleted and not updated, but they would find the new version afterwards.

I make sure to have no concurrent transactions on the same heapfile by getting a snapshotAny and waiting for all other transactions to end.
After that all new transactions will write new tuples to a new heapfile.
Within the old heapfile there will be just deletes, which are in-place.
I Synchronise heapfile operations with BUFFER_LOCK_SHARE / BUFFER_LOCK_EXCLUSIVE.

My algorithm would have much better performance and would be simpler, because i could work on a page-per-page basis.
I run it just once on each table. Afterwards the tuples can be updated as usual.


So the Question is for the later effects.
What is the loss? Would vacuum have any problem?

I am working on a project based on "postgres (PostgreSQL) 8.5devel" with the code from several master thesises befor me.

Thanks for answers.
Henning



Responses

pgsql-hackers by date

Next:From: Michael PaquierDate: 2012-11-23 14:48:58
Subject: Re: [WIP] pg_ping utility
Previous:From: Michael MeskesDate: 2012-11-23 13:42:48
Subject: Re: fix ecpg core dump when there's a very long struct variable name in .pgc file

pgsql-cluster-hackers by date

Next:From: Markus WannerDate: 2012-11-23 15:08:51
Subject: Re: [pgsql-cluster-hackers] Question: Can i cut NON-HOT chain Pointers if there are no concurrent updates?
Previous:From: Robert HaasDate: 2012-10-22 21:02:13
Subject: Re: "pg_ctl promote" exit status

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group