Re: The planner hates me.

Поиск
Список
Период
Сортировка
От Jeff Amiel
Тема Re: The planner hates me.
Дата
Msg-id C17A452040EDB84AA7A10AEA334E3E1455D1C5@AD1
обсуждение исходный текст
Ответ на The planner hates me.  ("Jeff Amiel" <JAmiel@istreamimaging.com>)
Список pgsql-general
-----Original Message-----
From: Hoover, Jeffrey [mailto:jhoover@jcvi.org]

change t.date2< dates.date to t.date2+0<dates.date, this will prevent
the query from trying to use the index on date2 because the where clause
now references an expression and not the column itself:

explain analyze
select sum(amount),  dates.date as date
from transaction t
join (select get_dates as date from get_dates('09/17/08','09/24/08'))
dates
  on (t.state='I' or t.date1 >=  dates.date) and t.date2+0<dates.date
group by dates.date



Yup...that did the trick.....whodathunkit?

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: The planner hates me.
Следующее
От: Marcus Engene
Дата:
Сообщение: regexp_replace() [noindex] thing