RE: [GENERAL] Optimal indicies
| От | Oleg Broytmann |
|---|---|
| Тема | RE: [GENERAL] Optimal indicies |
| Дата | |
| Msg-id | Pine.SOL2.3.96.SK.990421125028.22429A-100000@sun.med.ru обсуждение исходный текст |
| Ответ на | RE: [GENERAL] Optimal indicies ("Jackson, DeJuan" <djackson@cpsgroup.com>) |
| Ответы |
RE: [GENERAL] Optimal indicies
|
| Список | 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 по дате отправления: