Re: Equivalent queries and the planner

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Equivalent queries and the planner
Дата
Msg-id 1129426179.8219.44.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Equivalent queries and the planner  ("John D. Burger" <john@mitre.org>)
Список pgsql-general
On Fri, 2005-14-10 at 09:43 -0400, John D. Burger wrote:
> I believe these queries are exactly equivalent, but I presume the
> planner doesn't know that.

> explain select gazPlaceID from gazPlaces
>     where gazPlaceID not in (select gazPlaceID from gazContainers);

> explain select gazPlaceID from gazPlaces
>     except select gazPlaceID from gazContainers;

Yeah, query optimization for set operations is currently quite
primitive; the above transformation is not yet implemented.

> In general, there are lots of ways to express the same abstract
> information need in SQL, and I assumed that there were some set of
> (probably incomplete) equivalencies encoded somewhere.  Is this so?

I don't know of a canonical list of planner transformations. There are
some presentations on planner internals that touch on this, which is
better than nothing:

http://neilc.treehou.se/optimizer.pdf
http://conferences.oreillynet.com/presentations/os2003/lane_tom.pdf

-Neil



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

Предыдущее
От: Chris Travers
Дата:
Сообщение: Re: On "multi-master"
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Question/problem with create view and restore a backup with such a view