Re: Again: Identity not discovered by planner? - Mailing list pgsql-sql

From Tom Lane
Subject Re: Again: Identity not discovered by planner?
Date
Msg-id 2329.1019753830@sss.pgh.pa.us
Whole thread Raw
In response to Again: Identity not discovered by planner?  (Daniel Lundin <daniel@helena-daniel.se>)
List 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 by date:

Previous
From: David Stanaway
Date:
Subject: Re: SELECT in a function != SELECT ?
Next
From: Ian Morgan
Date:
Subject: Re: How to discover foreign keys (without pulling hair out)