Re: Again: Identity not discovered by planner?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Again: Identity not discovered by planner?
Дата
Msg-id 2329.1019753830@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Again: Identity not discovered by planner?  (Daniel Lundin <daniel@helena-daniel.se>)
Список pgsql-sql
Daniel Lundin <daniel@helena-daniel.se> writes:
> I would have thought that the planner would notice that child.parent =
> parent.id = 1193, implies that child.parent = 1193,

Nope, it does not.

It will notice transitive equality of variables, but that happens to
fall out of processing that it has to do anyway to recognize sort keys
for mergejoins.  Constants aren't interesting for join planning so they
are not handled in that code.

Offhand I do not see a way of recognizing this case that wouldn't expend
a great deal more cycles than it's likely to be worth.
        regards, tom lane


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

Предыдущее
От: David Stanaway
Дата:
Сообщение: Re: SELECT in a function != SELECT ?
Следующее
От: Ian Morgan
Дата:
Сообщение: Re: How to discover foreign keys (without pulling hair out)