Which index can i use ?

From: Abandoned <besturk(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Which index can i use ?
Date: 2007-10-28 13:09:59
Message-ID: 1193576999.533268.294820@y42g2000hsy.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi..
I want to do index in postgresql & python.
My table:
id(int) | id2(int) | w(int) | d(int)

My query:
select id, w where id=x and id2=y (sometimes and d=z)

I have too many insert and select operation on this table.
And which index type can i use ? Btree, Rtree, Gist or Hash ?
Also I want to unique (id, id2)..
Now this is my index. is it give me good performance ?
CREATE UNIQUE INDEX ind1 ON test USING btree (id, id2)
CREATE INDEX ind2 ON test USING btree (id)
CREATE INDEX ind3 ON test USING btree (id2)
CREATE INDEX ind4 ON test USING btree (w)
CREATE INDEX ind5 ON test USING btree (d)

I'm too sorry my bad english.
King regards..

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Perry Smith 2007-10-28 14:16:02 Re: createdb argument question
Previous Message rski 2007-10-28 11:58:17 plperl ubuntu problem