Re: GiST: PickSplit and multi-attr indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Teodor Sigaev <teodor(at)stack(dot)net>
Subject: Re: GiST: PickSplit and multi-attr indexes
Date: 2004-11-15 15:19:45
Message-ID: 7879.1100531985@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <neilc(at)samurai(dot)com> 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 tuples in the node to be
> split. There is no provision for the GiST extension to be informed about
> any additional attributes in the index tuples. Even if we changed the
> API to allow that, the GiST extension would have a hard time making a
> reasonable decision in the multi-attribute case: the additional index
> attributes could well be implemented using a different GiST extension.

Right, when you consider attributes of different types it gets tough.

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", "definitely right", or "don't care" (think "less",
"greater", or "equal to" the desired split value). If there is another
index column, you then invoke its PickSplit on just the "don't care" set
to try to classify them; and so on. Once you are out of columns, any
remaining "don't care" set is split using some standardized method like
trying to equalize the physical space.

Of course this requires API changes for PickSplit (not only a more
complex result, but it will have to deal with null inputs). But it
seems like it would be localized otherwise. Also it might allow removal
of duplicated logic to deal with splitting equal values sanely.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2004-11-15 15:24:56 Re: 8.0 press release
Previous Message Travis P 2004-11-15 14:50:55 Re: psql \e broken again