Re: Index isn't used during a join.

От: Michael Fuhr
Тема: Re: Index isn't used during a join.
Дата: ,
Msg-id: 20060111090008.GA51672@winnie.fuhr.org
(см: обсуждение, исходный текст)
Ответ на: Re: Index isn't used during a join.  (Michael Fuhr)
Список: pgsql-performance

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

Index isn't used during a join.  (Robert Creager, )
 Re: Index isn't used during a join.  (Michael Fuhr, )
  Re: Index isn't used during a join.  (Robert Creager, )
  Re: Index isn't used during a join.  (Robert Creager, )
   Re: Index isn't used during a join.  (Michael Fuhr, )
    Re: Index isn't used during a join.  (Michael Fuhr, )
    Re: Index isn't used during a join.  (Robert Creager, )
     Re: Index isn't used during a join.  (Robert Creager, )
      Re: Index isn't used during a join.  (Michael Fuhr, )
     Re: Index isn't used during a join.  (Tom Lane, )
      Re: Index isn't used during a join.  (Robert Creager, )

On Wed, Jan 11, 2006 at 12:56:55AM -0700, Michael Fuhr wrote:
> WHERE ...
>   AND doy >= EXTRACT(doy FROM now() - '24 hour'::interval)
>   AND doy <= EXTRACT(doy FROM now())

To work on 1 Jan this should be more like

WHERE ...
  AND (doy = EXTRACT(doy FROM now() - '24 hour'::interval) OR
       doy = EXTRACT(doy FROM now()))

In any case the point is to add conditions to the WHERE clause that
will use an index on the table for which you're currently getting
a sequential scan.

--
Michael Fuhr


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

От: Robert Creager
Дата:
Сообщение: Re: Index isn't used during a join.
От: Robert Creager
Дата:
Сообщение: Re: Index isn't used during a join.