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

From Greg Stark
Subject Re: GiST: PickSplit and multi-attr indexes
Date
Msg-id 87wtwl7bqe.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: GiST: PickSplit and multi-attr indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: GiST: PickSplit and multi-attr indexes  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> 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, or at least values that
> are similar enough to qualify as don't-cares.

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
equally important.

For a concrete example, say you wanted to index a 2d cartesian coordinate. If
you stored it in a single column using the point data type (or a 2 element
array) then the PickSplit function can use both coordinates to determine its
split. A GiST index on two separate integer columns really shouldn't be
prevented from operating in the same way.

-- 
greg



pgsql-hackers by date:

Previous
From: Thomas Hallgren
Date:
Subject: Minor problem with Makefile.shlib
Next
From: Andrew Dunstan
Date:
Subject: Re: Minor problem with Makefile.shlib