Re: [SQL] Difference between these two queries ?

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: [SQL] Difference between these two queries ?
Дата
Msg-id 20100606153604.GV20550@samason.me.uk
обсуждение исходный текст
Ответ на Re: [SQL] Difference between these two queries ?  ("Little, Douglas" <DOUGLAS.LITTLE@orbitz.com>)
Список pgsql-general
On Sun, Jun 06, 2010 at 10:15:52AM -0500, Little, Douglas wrote:
> They should generate equivalent results,
> But the difference is the constraint on bu.bid=5.
> In the 1st case it's being done after the join.
> In the 2nd case it is being done before the join.

In PG version 8.1 (?) and onwards, the query planner knows that they are
equivalent and will choose from the same types of plans.  I.e. it's just
a syntax issue, do whichever you think is "prettier", the semantics are
the same.

--
  Sam  http://samason.me.uk/

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

Предыдущее
От: "Little, Douglas"
Дата:
Сообщение: Re: [SQL] Difference between these two queries ?
Следующее
От: Nilesh Govindarajan
Дата:
Сообщение: Re: Difference between these two queries ?