Re: [HACKERS] GiST: PickSplit and multi-attr indexes

2004-11-16 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> 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 d

Re: [HACKERS] GiST: PickSplit and multi-attr indexes

2004-11-16 Thread Greg Stark
Greg Stark <[EMAIL PROTECTED]> writes: > I'm not sure that GiST indexes behave the same way as btree indexes for the > multi-column case. > > In a btree index the second column is entirely subordinate to the first > column. In a GiST index the data is multi-dimensional, and all dimensions are >

Re: [HACKERS] GiST: PickSplit and multi-attr indexes

2004-11-16 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > If there are no don't-care cases, then you're effectively saying that > the first column's PickSplit has sole control over the tree shape, > which is where we're at now. ISTM the entire point of a multi-column > index is that the first column has duplicates

Re: [HACKERS] GiST: PickSplit and multi-attr indexes

2004-11-16 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > On Mon, 2004-11-15 at 10:19 -0500, Tom Lane wrote: >> I'm not familiar with the details of the GiST code, but would it work to >> generalize PickSplit to return a three-way classification? That is, >> instead of actually splitting the node, have it identif

Re: [HACKERS] GiST: PickSplit and multi-attr indexes

2004-11-15 Thread Neil Conway
On Mon, 2004-11-15 at 10:19 -0500, Tom Lane wrote: > I'm not familiar with the details of the GiST code, but would it work to > generalize PickSplit to return a three-way classification? That is, > instead of actually splitting the node, have it identify each item as > "definitely left", "definite

Re: [HACKERS] GiST: PickSplit and multi-attr indexes

2004-11-15 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > I'm not sure the right way to fix it (at least without significant > changes to the GiST API). At present, the PickSplit() method is passed a > vector of GISTENTRYs and fills in a GIST_SPLITVEC. The GISTENTRYs > correspond to the first attributes of all the

Re: [HACKERS] GiST: PickSplit and multi-attr indexes

2004-11-15 Thread Oleg Bartunov
Neil, I think we should not touch this right now unless you certainly know algorithm proven to be good in general case. Did you already got some idea ? Oleg On Mon, 15 Nov 2004, Neil Conway wrote: On Sun, 2004-11-14 at 18:54 -0500, Tom Lane wrote: It's probably just a hangover from the days

Re: [HACKERS] GiST: PickSplit and multi-attr indexes

2004-11-14 Thread Neil Conway
On Sun, 2004-11-14 at 18:54 -0500, Tom Lane wrote: > It's probably just a hangover from the days when GiST didn't support > multi-column indexes at all. I agree it should be changed. I'm not sure the right way to fix it (at least without significant changes to the GiST API). At present, the PickS

Re: [HACKERS] GiST: PickSplit and multi-attr indexes

2004-11-14 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > If I understand the code correctly, GiST will only pass the first > attribute of each index tuple to the user-defined PickSplit method when > it wants to split a node. (see circa line 1269 of gist.c) > Is this a wise design decision? It's probably just

[HACKERS] GiST: PickSplit and multi-attr indexes

2004-11-14 Thread Neil Conway
Oleg & Teodor, If I understand the code correctly, GiST will only pass the first attribute of each index tuple to the user-defined PickSplit method when it wants to split a node. (see circa line 1269 of gist.c) Is this a wise design decision? Granted, in many situations the first attribute in t