Re: Equivalent queries and the planner

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Equivalent queries and the planner
Дата
Msg-id 20051015142405.GC14113@svana.org
обсуждение исходный текст
Ответ на Equivalent queries and the planner  ("John D. Burger" <john@mitre.org>)
Список pgsql-general
On Fri, Oct 14, 2005 at 09:43:57AM -0400, John D. Burger wrote:
> (By the way, gazPlaces.gazPlaceID below is a primary key, so should be
> unique - I think that's required for these to be equivalent.  I tested
> the two queries on small data sets, and they do indeed return the same
> results.)

I think that you also have to be sure that gazPlaceID is never NULL.
AFAIK the PostgreSQL doesn't track that sort of thing at all at the
planning/optimisation stage.

You're right, sometimes statements are equivalent but usually there is
some corner case (like NULLs, duplicate values, etc) that screw it up
for the general case. Teaching the planner all that is something not
yet done.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: Oracle buys Innobase
Следующее
От: "Magnus Hagander"
Дата:
Сообщение: Re: Windows Installation error