Scan by TID (was RE: [HACKERS] How to add a new build-in operator) - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject Scan by TID (was RE: [HACKERS] How to add a new build-in operator)
Date
Msg-id 000b01bf10aa$4816c600$2801007e@cadzone.tpf.co.jp
Whole thread Raw
In response to Re: [HACKERS] How to add a new build-in operator  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
Responses Re: Scan by TID (was RE: [HACKERS] How to add a new build-in operator)  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
> > I'm planning to implement a new type of scan,scan by TID.
> > It's on TODO      * Allow WHERE restriction on ctid.
> > First,I want to define an equal operator between TID.
> 
> Certainly, or perhaps it would be better to recycle an OID from
> farther down? We have some open values, and if you only need a few it
> would work well.
> 
> You probably already know this, but just in case,
> 
> cd src/include/catalog
> ./unused_oids
>

I didn't know it.
Thanks.
I would use OIDs for '=' operator between TIDs as follows.387    for = (tid, tid)1292    for tideq(tid, tid)


Unfortunately,TIDs are changed by UPDATE operations.
So we would need some functions in order to get the latest
TID of a specified tuple such as currtid(relationid/name, tid) which returns tid.
I would provide functions for both relid and relname and
use 1293-1294 for OIDs of these functions.

Comments ?
If there's no objection,I would commit them to the current tree.

Moreover,we would need to know TIDs of inserted tuples.
What is a reasonable way to do so ?
1.  Add TID to return_info of INSERT commands.
2.  Provide a function to get TID of the last inserted tuple    of the session(backend).
... 

Any ideas ?

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp 


pgsql-hackers by date:

Previous
From: Roland Roberts
Date:
Subject: Re: [HACKERS] psql Week 1
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] union and LIMIT problem