Skip site navigation (1) Skip section navigation (2)

Re: Multicolumn index doc out of date?

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-docs(at)postgresql(dot)org,Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Subject: Re: Multicolumn index doc out of date?
Date: 2005-10-21 09:57:12
Message-ID: 4358BB78.5050303@sigaev.ru (view raw or flat)
Thread:
Lists: pgsql-docs

Tom Lane wrote:
> [ getting back to this documentation issue finally ]
> 
> Teodor Sigaev <teodor(at)sigaev(dot)ru> writes:
> 
>>I disagree with last affirmation: inner pages of index contains fair union of 
>>keys and enough helpful to select. Mailware ( http://www.pgsql.ru/db/mw ) 
>>sucsessfully use combined GiST index (date, tsvector) for searching.
> 
> 
>>GiST's split algorithm is good for unique leading keys, not so bad for small 
>>number of non-unique values and bad for all equals leading key. But "bad" means 
>>that itsn't optimal as picksplit for other keys may be. If there is several keys 
>>which can be moved on left or right page without changing union of first key for 
>>each page then GiST try put its on page (left or right) with smallest penalty 
>>calculated by other keys. This algorithm is very similar to defining page to put 
>>tuple with normal processing (without page split).
> 
> 
>>With unique leading key GiST's split is fully similar to BTree - it looks only 
>>at leading key, but gistchoose isn't. Gistchoose (gistutil.c:622) chooses child 
>>with smallest penalty and it looks to other keys if several leading keys has the 
>>same penalty. In a GiST tree different keys may have the same penalty value with 
>>new key.
> 
> 
> OK, how about this text then?
> 
>    A multicolumn GiST index can only be used when there is a query condition
>    on its leading column.  Conditions on additional columns restrict the
>    entries returned by the index, but the condition on the first column is the
>    most important one for determining how much of the index needs to be
>    scanned.  A GiST index will be relatively ineffective if its first column
>    has only a few distinct values, even if there are many distinct values in
>    additional columns.

Ok, I think.

-- 
Teodor Sigaev                                   E-mail: teodor(at)sigaev(dot)ru
                                                    WWW: http://www.sigaev.ru/

In response to

pgsql-docs by date

Next:From: Oleg BartunovDate: 2005-10-21 14:40:03
Subject: Re: Multicolumn index doc out of date?
Previous:From: Tom LaneDate: 2005-10-21 00:35:01
Subject: Re: Multicolumn index doc out of date?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group