Re: [HACKERS] Indexing for geographic objects?

From: selkovjr(at)mcs(dot)anl(dot)gov
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: Michael Ansley <Michael(dot)Ansley(at)intec-telecom-systems(dot)com>, "'Tom Lane '" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'pgsql-general '" <pgsql-general(at)postgresql(dot)org>, "'pgsql-hackers '" <pgsql-hackers(at)postgresql(dot)org>, "'t(dot)h(dot)p(dot)ansley(at)durham(dot)co(dot)uk'" <t(dot)h(dot)p(dot)ansley(at)durham(dot)co(dot)uk>
Subject: Re: [HACKERS] Indexing for geographic objects?
Date: 2000-11-26 19:15:20
Message-ID: 200011261915.NAA15183@selkovjr.xnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> wrote:
>
> I'm also interested in GiST and would be happy if somebody could provide
> workable example. I have an idea to use GiST indices for our fulltextsearch
> system.
>

I have recently replied to Franck Martin in regards to this indexing
question, but I didn't think the subject was popular enough for me to
contaminate the list(s). You prove me wrong. Here goes:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To: Franck Martin <franck(at)sopac(dot)org>
From: selkovjr(at)mcs(dot)anl(dot)gov
Reply-to: selkovjr(at)mcs(dot)anl(dot)gov
Subject: Re: [HACKERS] Indexing for geographic objects?
In-reply-to: <3A1EE0F4(dot)3DC4161B(at)sopac(dot)org>
Comments: In-reply-to Franck Martin <franck(at)sopac(dot)org>
message dated "Sat, 25 Nov 2000 10:43:16 +1300."
Mime-Version: 1.0 (generated by tm-edit 7.108)
Date: Sat, 25 Nov 2000 02:56:03 -0600

It is probably possible to hook up an extension directly with the
R-tree methods available in postgres -- if you stare at the code long
enough and figure how to use the correct strategies. I chose an easier
path years ago and I am still satisfied with the results. Check out
the GiST -- a general access method built on top of R-tree to provide
a user-friendly interface to it and to allow indexing of more abstract
types, for which straight R-tree is not directly applicable.

I have a small set of complete data types, of which a couple
illustrate the use of GiST indexing with the geometrical objects, in:

http://wit.mcs.anl.gov/~selkovjr/pg_extensions/

If you are using a pre-7.0 postrgres, grab the file contrib.tgz,
otherwise take contrib-7.0.tgz. The difference is insignificant, but
the pre-7.0 version will not fit the current schema. Unpack the source
into postgresql-*/contrib and follow instructions in the README
files. The types of interest for you will be seg and cube. You will
find pointers to the original sources and docs in the CREDITS section
of the README file. I also have a version of the original example code
in pggist-patched.tgz, but I did not check if it works with current
postgres. It should not be difficult to fix it if it doesn't -- the
recent development in the optimizer area made certain things
unnecessary.

You might want to check out a working example of the segment data type at:

http://wit.mcs.anl.gov/EMP/indexing.html

(search the page for 'KM')

I will be glad to help, but I would also recommend to send more
sophisticated questions to Joe Hellerstein, the leader of the original
postgres team that developed GiST. He was very helpful whenever I
turned to him during the early stages of my data type project.

--Gene

In response to

Browse pgsql-general by date

  From Date Subject
Next Message GH 2000-11-26 21:25:38 Bug? 'psql -l' in pg_ctl?
Previous Message Oleg Bartunov 2000-11-26 14:55:58 RE: [HACKERS] Indexing for geographic objects?

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 2000-11-26 20:19:03 Re: when will PostgreSQL 7.1?
Previous Message Tom Samplonius 2000-11-26 18:58:34 Re: Re: [NOVICE] Re: re : PHP and persistent connections