Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA13164; Mon, 27 Jul 92 06:58:26 -0700
Message-Id: <9207271358.AA13164@postgres.Berkeley.EDU>
From: "Schenkelaars.V.F" <V.F.Schenkelaars@fel.tno.nl>
Subject: Adding a new access method (long)
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
To: postgres@postgres.berkeley.edu (Postgres mailing list)
Date: Mon, 27 Jul 92 16:13:58 MET DST
Cc: pjmg1@tnofel.fel.tno.nl (Peter van Oosterom),
        mao@postgres.berkeley.edu (Mike Olson)
X-Mailer: ELM [version 2.3 PL11]

Dear Postgres Group,

I'm preparing to create a new access method for postgres. I`ve 
studied the R-tree code as provided with the postgres system and 
have come to teh following "recipe":

The Reactive Tree is a modified R-tree so I can use the
rtree functions as a template.
I have to create the following functions for my access method the
Reactive Tree:
Reactgettuple      (rtgettuple)
Reactinsert        (rtinsert)
Reactdelete        (rtdelete)
Reactbeginscan     (rtbegins)
Reactrescan        (rtrescan)
Reactendscan       (rtendscan)
Reactmarkpos       (rtmarkpos)
Reactrestrpos      (rtrestrpos)
Reactbuild         (rtbuild)

These functions are registred in the pg_proc relation.

My first question: Are these the only one I have to make or
am I missing some functions?

Next I append a tuple to pg_am.  
pg_am
 (
 amname = char16 ,		<=  "Reactive-tree"
 amowner = oid ,		<=  is added automaticly
 amkind = char ,		<=  "o" ? but what does this mean?
 amstrategies = int2 ,		<=  Do I have to give the number of
				    strategies here? btree has 5 but
				    rtree does have 5 here too. I
				    assumed the rtree has got 8 
                                    strategies, or am I wrong?
 amsupport = int2 ,		<=  number of support functions: Union,
                                    Intersect and Size ?
 amgettuple = regproc ,		<=  Reactgettuple
 aminsert = regproc ,		<=  Reactdelete
 amdelete = regproc ,		<=  Reactdelete
 amgetattr = regproc ,		<=  - ? unknown to me
 amsetlock = regproc ,		<=  - ? unknown to me
 amsettid = regproc ,		<=  - ? unknown to me
 amfreetuple = regproc ,	<=  - ? unknown to me
 ambeginscan = regproc ,	<=  Reactbeginscan
 amrescan = regproc ,		<=  Reactrescan
 amendscan = regproc ,		<=  Reactendscan
 ammarkpos = regproc ,		<=  Reactmarkpos
 amrestrpos = regproc ,		<=  Reactrestrpos
 amopen = regproc ,		<=  - ? unknown to me
 amclose = regproc ,		<=  - ? unknown to me
 ambuild = regproc ,		<=  Reactbuild 
 amcreate = regproc ,		<=  - ? unknown to me
 amdestroy = regproc		<=  - ? unknown to me
 )

Could yould answer the questionmarks in this table. I guess it just
doesn`t aplly to the rtree access method.

Next I have to create a opclass. But since the Reactive tree is 
similar to thre R-tree I just can use the R-tree opclasses. Or
am I wrong?


After this I should be able to define a Reactive Tree index:

define index react-tree on test using Reactive-tree (bbox box_ops)`

where test is a relation with attribute bbox of type box.

My final question is: Is this the correct "recipe" for 
adding an access method. Or did I miss something. 

I don't want to waste a lot of time trying things that won't
work. So I`ll be very pleased if you could answer my questions.

Regards
     ____________________
 \  / . _   _  _   _  |
  \/ ( ( \ (_ (-' ( \ |

--------------------------------------------------------------------------------
Vincent F. Schenkelaars				|
Company: FEL-TNO                                | Private:
Email  : V.F.Schenkelaars@tnofel.fel.tno.nl	|
address: Oude Waalsdorperweg 63			| Groenhovenstraat 12
         Postbus 96864				|
         2509 JG  Den Haag			| 2311 BT  Leiden
         The Netherlands			| The Netherlands
Phone  : Holland 070-3264221			| Holland 071-125576
Fax    : Holland 070-3280961			|
--------------------------------------------------------------------------------
We apologize for the inconvenience.
