Re: Increasing select max(datecol) from bilkaib wheredatecol<=date'2008-11-01' and (cr='00' or db='00') speed

От: Andrus
Тема: Re: Increasing select max(datecol) from bilkaib wheredatecol<=date'2008-11-01' and (cr='00' or db='00') speed
Дата: ,
Msg-id: gffcgj$1sjh$1@news.hub.org
(см: обсуждение, исходный текст)
Ответ на: Re: Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed  (hubert depesz lubaczewski)
Список: pgsql-performance

Скрыть дерево обсуждения

Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed  ("Andrus", )
 Re: Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed  (Matthew Wakeling, )
 Re: Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed  ("Vladimir Sitnikov", )
  Re: Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed  (Matthew Wakeling, )
   Re: Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed  ("Andrus", )
    Re: Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed  ("Vladimir Sitnikov", )
     Re: Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed  ("Andrus", )
 Re: Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed  (hubert depesz lubaczewski, )
  Re: Increasing select max(datecol) from bilkaib wheredatecol<=date'2008-11-01' and (cr='00' or db='00') speed  ("Andrus", )

Depesz,

> do you always have this: "(cr='00' or db='00')"? or do the values (00)
> change?
> if they don't change, or *most* of the queries have "(cr='00' or
> db='00')", than the biggest time difference you will get after creating
> this index:
> create index test on bilkaib (kuupaev) where cr='00' or db='00';

I have always  cr='00' or db='00'  clause. Separate values are never tested.
I changed by queries back to old values and created this single index.
This seems to be even better that Vladimir suggestion.
Thank you very much.

Andrus.



В списке pgsql-performance по дате сообщения:

От: Tomas Vondra
Дата:
Сообщение: Re: Using index for IS NULL query
От: "Scott Marlowe"
Дата:
Сообщение: Re: Performance Question