RE: [GENERAL] Optimal indicies - Mailing list pgsql-general

From Oleg Broytmann
Subject RE: [GENERAL] Optimal indicies
Date
Msg-id Pine.SOL2.3.96.SK.990421125028.22429A-100000@sun.med.ru
Whole thread Raw
In response to RE: [GENERAL] Optimal indicies  ("Jackson, DeJuan" <djackson@cpsgroup.com>)
Responses RE: [GENERAL] Optimal indicies  (Remigiusz Sokolowski <rems@gdansk.sprint.pl>)
List pgsql-general
Hi!

On Tue, 20 Apr 1999, Jackson, DeJuan wrote:
> The reason I chose those tow columns is because they are the only one that
> will be seen in that where clause.
> So position should be indexed on subsec_id, status, and pos_id.

   Sounds reasonable.

> My general rule of thumb is to stay away from OR clause in PostgreSQL (which
> is what an IN or NOT IN translate to), and index the columns that are

   I heared an advice (from Vadim, who implemented this) that IN is not
very effective. EXIST and correlated subqueries are much better.

> definitely included in most where clauses on that table.

   Should these indicies be created as compound index (CREATE INDEX myindex
ON TABLE mytable (field1, field2)) or separated
(
   CREATE INDEX myindex1 ON TABLE mytable (field1)
   CREATE INDEX myindex2 ON TABLE mytable (field2)
)
   ?

>     -DEJ

Oleg.
----
    Oleg Broytmann     http://members.xoom.com/phd2/     phd2@earthling.net
           Programmers don't die, they just GOSUB without RETURN.


pgsql-general by date:

Previous
From: listuser
Date:
Subject: XML objects in Postgres
Next
From: Remigiusz Sokolowski
Date:
Subject: RE: [GENERAL] Optimal indicies