Which index can i use ?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Sun Oct 28 09:21:24 EDT 2007


On Sun, 28 Oct 2007 06:00:19 -0700, Abandoned wrote:

> 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)

This isn't a Python question.  You'll get more and probably better
feedback in a group, mailing list or forum dealing with PostgreSQL.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list