Indices types, what to use. Btree, Hash, Gin or Gist

Поиск
Список
Период
Сортировка
От Mohamed
Тема Indices types, what to use. Btree, Hash, Gin or Gist
Дата
Msg-id 861fed220901311121sfcfc490sc408889e71e555c6@mail.gmail.com
обсуждение исходный текст
Ответы Re: Indices types, what to use. Btree, Hash, Gin or Gist
Список 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 по дате отправления:

Предыдущее
От: Jasen Betts
Дата:
Сообщение: Re: Pet Peeves?
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: Pet Peeves?