Re: contrib/rtree_gist into core system?

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "John Hansen" <john(at)geeknet(dot)com(dot)au>, "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, "Greg Stark" <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: contrib/rtree_gist into core system?
Date: 2005-06-27 06:47:40
Message-ID: 87slz41ek3.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> "John Hansen" <john(at)geeknet(dot)com(dot)au> writes:
>
> > Simplicity!
> > Implementing rtree operators and support functions is FAR simpler than
> > implementing the GiST equivalents.
>
> Mmm ... not really. It does seem that we could offer some sort of
> generic set of gist support routines that understand rtree-like
> semantics (all the picksplit routines seem suspiciously similar,
> for instance).

I think the picksplit part of the API is the strangest part. Normally when you
design data types you think in terms of your data type and the operations on
it. You shouldn't suddenly have to immerse yourself in some nitty gritty ADTs
for index pages.

I believe all the picksplit functions are based on (apparently via copy/paste)
a single algorithm that depends on a single operator: a kind of "distance"
function. Usually it's the same function underlying the penalty gist api
function. That's a natural operator to implement for data types and one that
doesn't involve learning about any extraneous implementation details of gist
indexing.

If gist index operator classes could be activated based entirely on data type
operators like "distance" and "union" and "penalty" instead of this strange
"picksplit" function then it would make implementing them *much* easier.

Moreover it would solve the multicolumn index issue. There are a probably
other options but the simplest would be to simply take the inner product of
the results of the various distance functions.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew - Supernews 2005-06-27 07:16:52 Re: Sigh, another contrib/cube and contrib/seg problem
Previous Message Stephen Frost 2005-06-27 06:40:36 Re: Users/Groups -> Roles