Re: GiST: PickSplit and multi-attr indexes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: GiST: PickSplit and multi-attr indexes
Date
Msg-id 2761.1100641040@sss.pgh.pa.us
Whole thread Raw
In response to Re: GiST: PickSplit and multi-attr indexes  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@MIT.EDU> writes:
> The approach they take is to have a function which calculates an
> abstract "distance" between any two entries. There's an algorithm that
> they use to pick the split based on this distance function.

> If you abandoned "PickSplit" and instead exposed this distance
> function as the external API then the behaviour for multi-column
> indexes is clear. You calculate the distance along all the axes and
> calculate the diagonal distance.

Hmm ... the problem with that is the assumption that different opclasses
will compute similarly-scaled distances.  If opclass A generates
distances in the range (0,1e6) while B generates in the range (0,1),
combining them with Euclidean distance won't work well at all.  OTOH you
can't blindly normalize, because in some cases maybe the data is such
that a massive difference in distances is truly appropriate.

I'm also a bit leery of the assumption that every GiST application can
reduce its PickSplit logic to Euclidean distances.
        regards, tom lane


pgsql-hackers by date:

Previous
From: John Hansen
Date:
Subject: Unicode characters above 0x10000 #2
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] plperl Safe restrictions