Indices types, what to use. Btree, Hash, Gin or Gist - Mailing list pgsql-general

From Mohamed
Subject Indices types, what to use. Btree, Hash, Gin or Gist
Date
Msg-id 861fed220901311121sfcfc490sc408889e71e555c6@mail.gmail.com
Whole thread Raw
Responses Re: Indices types, what to use. Btree, Hash, Gin or Gist  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-general
Hi,

I have several fields that use to match with my queries. I am curious to what index types is best for what. Here is some examples that will help you understand.

Say I have a 1000 000 rows.

Speed is of the essence here, insertions and updates happens relatively less frequent than search. 

I want to match against a boolean field, that is, only true or false is possible. I am thinking Btree but not sure.. correct?

Match against a field which is an big in and contains the ids for the states of america (say 50 different values), a btree again?

Against an integer field? Using > < = and between

Date (no timezone), I would like to have this field presorted in desc order. How does that creation look like?

I understand the Hash is not recommended. When should I use the Gin index ?

Thanks in advance / Moe 






pgsql-general by date:

Previous
From: Jasen Betts
Date:
Subject: Re: Pet Peeves?
Next
From: Jasen Betts
Date:
Subject: Re: Pet Peeves?