Re: Any "guide to indexes" exists?

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Any "guide to indexes" exists?
Date: 2007-05-07 20:51:58
Message-ID: 60tzuo9x1t.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

bilekj(at)gmail(dot)com ("Jan Bilek") writes:
> I was asking for these "specific/particular reasons". Im not the
> database developer, to be expert on indexes (i know whats btree and
> hash - gin and gist are rather mysterious for me).
> Ok - btree is fine, but sometimes could be better to use gist - my
> question is: when is that "sometimes"? Unless i know how to use the
> indexes, then they are useless for me - am i right?
>
> Note: We are using gin with tsearch2 vectors, but here we had no
> choice -
> tsearch2 works only with gin and gist.

>> You use btree unless you have a specific, particular reason to use
>> one of the
>> other ones.

Peter's comments are pretty germane.

You use btree if you can. btree is fine for anything where values are
reasonable "scalar," and compare to one another either in a
straightforward scalar fashion, or piece-wise scalar, as with compound
keys where you start by comparing the first component, then, if it's
equal, considering the second, and so on.

You use GIST if you *need to*, if you have a data structure where
values *aren't* scalar, *can't* be compared (e.g. - where you can't
simply say A > B, B > C).
--
"cbbrowne","@","cbbrowne.com"
http://cbbrowne.com/info/wp.html
"Access to a COFF symbol table via ldtbread is even less abstract,
really sucks in general, and should be banned from earth."
-- SCSH 0.5.1 unix.c

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jonas Henriksen 2007-05-07 21:23:34 Re: Slow query and indexes...
Previous Message Rich Shepard 2007-05-07 20:44:06 Re: Date Math