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

CTID issues and a soc student in need of help

From: Tzahi Fadida <tzahi(dot)ml(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: CTID issues and a soc student in need of help
Date: 2006-06-01 12:33:50
Message-ID: 1149165230.7657.24.camel@llord (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
I am a Google soc student and in need of some help 
with PostgreSQL internals:

My C function can run (and already running)
for a very very long time on some
inputs and reiterate on relations using SPI.
Basically, I open portals and cursors to relations. 
Also note that I always open the
relations in READ ONLY mode using SPI.
A big no no is that some data in the relations
would change since that would just ruin everything.

I have a great need to identify a tuple uniquely so
my prototype uses the CTID field for that purpose.
Btw, this identification is required by the algorithm
and primary keys are just wasteful and will slow the process
considerably (not to mention some relations don't have primary keys).

The question is, can the CTID field change throughout
the run of my function due to some other processes working
on the relation? Or because of command boundaries it is
pretty much secured inside an implicit transaction?
The problem wasn't so great if I didn't want to exploit
indices in the relations (but I do and does), since
after you issue a SELECT that uses indices, all you can rely on
is the CTID to uniquely identify a tuple.

The other solution is to temporarily duplicate the relations but
this is less appealing (plus it's already working great with CTIDs).

Tzahi Fadida
Blog: | Home Site:


pgsql-hackers by date

Next:From: Mark WoodwardDate: 2006-06-01 12:52:59
Subject: Re: Possible TODO item: copy to/from pipe
Previous:From: Robert TreatDate: 2006-06-01 11:46:56
Subject: Re: [PATCH] Magic block for modules

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