Re: some optimization?

Поиск
Список
Период
Сортировка
От dima
Тема Re: some optimization?
Дата
Msg-id 3D89B30B.6050003@mail.ru
обсуждение исходный текст
Ответ на some optimization?  (Ciprian Popovici <ciprian.popovici@integrare.ro>)
Список pgsql-general
Ciprian Popovici wrote:
> select distinct on (code) id,code,active from objects \
> where version<=2 and (process=17 or process=0) \
> group by id,code,active,version \
> order by code asc,active desc,version desc
>
> I'm a bit green with Postgres. Is this query performant enough? Are
> there things I can do to make it better (indexing, some other method?)
> I have 'id' as the primary key and unique(code,version,active).
the common optimization step should surely be indexing on all the fields
used in "where" constraint. everything else depends on the various
additional parametres.



В списке pgsql-general по дате отправления:

Предыдущее
От: Jochem van Dieten
Дата:
Сообщение: Re: IN vs EXIIST
Следующее
От: Jean-Christian Imbeault
Дата:
Сообщение: Re: IN vs EXIIST