Re: New Index

Lists: pgsql-hackers
From: algatt <alangatt(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: New Index
Date: 2007-07-28 07:13:39
Message-ID: 1185606819.467932.130810@l70g2000hse.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello,

I am trying to create a new index for high multi-dimensional indexing.
The index I'm trying to use in PR-Tree ( www.cs.duke.edu/~yike/prtree/
).

I have created a new source file in "src/backend/access/" and for now
I have created the empty functions: build, insert, vacuum, etc... I
believe that this has to be done in C. Then I ran "/src/include/
catalog/unused_oids" to find the unused oids, and then i added the
oids to the functions in the source "file /src/include/catalog/
pg_proc.h". I re-ran initdb and inserted the functions in pg_am table.

Now obviously I have to add the proper code to the functions, but the
version of the code I have for the PR-Tree is in C++. Is there a way
to implement the functions using the existing PR-Tree code in C++?

Thanks for your help.

Regards,
Alan


From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: algatt <alangatt(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: New Index
Date: 2007-07-28 08:42:53
Message-ID: 46AB018D.7000709@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

algatt wrote:
> I am trying to create a new index for high multi-dimensional indexing.
> The index I'm trying to use in PR-Tree ( www.cs.duke.edu/~yike/prtree/
> ).
>
> I have created a new source file in "src/backend/access/" and for now
> I have created the empty functions: build, insert, vacuum, etc... I
> believe that this has to be done in C. Then I ran "/src/include/
> catalog/unused_oids" to find the unused oids, and then i added the
> oids to the functions in the source "file /src/include/catalog/
> pg_proc.h". I re-ran initdb and inserted the functions in pg_am table.

You seem to be on the right track.

> Now obviously I have to add the proper code to the functions, but the
> version of the code I have for the PR-Tree is in C++. Is there a way
> to implement the functions using the existing PR-Tree code in C++?

No, we don't support C++ in the backend. It's almost certainly easier to
just start from scratch anyway, because integrating it with all the
PostgreSQL infrastructure like the buffer manager, vacuum, WAL-logging,
data type and operator system.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: David Fuhry <dfuhry(at)cs(dot)kent(dot)edu>
To: algatt <alangatt(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, postgis-devel(at)postgis(dot)refractions(dot)net
Subject: Re: New Index
Date: 2007-07-28 16:55:34
Message-ID: 46AB7506.4090404@cs.kent.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

algatt,

You might find the examples of PostGIS [1] and SP-GiST [2] helpful
in implementing your PR-Tree index, although the former implements only
2D R-Trees and the latter implements tries, quadtrees, and kd-trees but
not R-Trees (and extends GiST).

Yours may be the first PostgreSQL R-Tree implementation which takes
advantage of bulk-loading. The Oracle Spatial guys have had a
bulk-loading implementation [3] since 10g, based on [4].

-Dave Fuhry

[1] http://postgis.refractions.net/
[2] http://www.cs.purdue.edu/spgist/
[3] Ning An, Kothuri Venkata Ravi Kanth, Siva Ravada: Improving
Performance with Bulk-Inserts in Oracle R-Trees. VLDB 2003: 948-951
[4] L. Arge, K. Hinrichs, et al. Efficient Bulk Operations
on Dynamic R-trees. In Workshop on Algorithm Engi-
neering and Experimentation (ALENEX), pages 328–
348, 1999.

Heikki Linnakangas wrote:
> algatt wrote:
>> I am trying to create a new index for high multi-dimensional indexing.
>> The index I'm trying to use in PR-Tree ( www.cs.duke.edu/~yike/prtree/
>> ).
>>
>> I have created a new source file in "src/backend/access/" and for now
>> I have created the empty functions: build, insert, vacuum, etc... I
>> believe that this has to be done in C. Then I ran "/src/include/
>> catalog/unused_oids" to find the unused oids, and then i added the
>> oids to the functions in the source "file /src/include/catalog/
>> pg_proc.h". I re-ran initdb and inserted the functions in pg_am table.
>
> You seem to be on the right track.
>
>> Now obviously I have to add the proper code to the functions, but the
>> version of the code I have for the PR-Tree is in C++. Is there a way
>> to implement the functions using the existing PR-Tree code in C++?
>
> No, we don't support C++ in the backend. It's almost certainly easier to
> just start from scratch anyway, because integrating it with all the
> PostgreSQL infrastructure like the buffer manager, vacuum, WAL-logging,
> data type and operator system.
>