От: Mischa
Тема: Re: date - range
Дата: ,
Msg-id: 1112423119.424e3acf49c9f@webmail.telus.net
(см: обсуждение, исходный текст)
Ответ на: Re: date - range  (Mischa)
Список: pgsql-performance

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

date - range  ("H.J. Sanders", )
 Re: date - range  (Michael Fuhr, )
 Re: date - range  (Mischa, )
  Re: date - range  (Mischa, )
  Re: date - range  (Michael Fuhr, )
   Re: date - range  (Bruno Wolff III, )

Quoting Mischa <>:

> SELECT  People.* FROM People
> JOIN Widths
> ON    People.start = today - today % Widths.width
> AND   People.width = Widths.width

Yikes! I hit the SEND button one ohnosecend too fast.

(1) You still ALSO have to test:
... AND today between first_date and last_date

(2) On some SQL engines, it makes a different to how the engine can re-order the
nested loops, if you make the index (width,start) instead of (start,width).
Haven't tried on PG8 yet.
"Dreams come true, not free."

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

От: Michael Fuhr
Сообщение: Re: date - range
От: Bruno Wolff III
Сообщение: Re: date - range