Re: Again: Identity not discovered by planner?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Lundin <daniel(at)helena-daniel(dot)se>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Again: Identity not discovered by planner?
Date: 2002-04-25 16:57:10
Message-ID: 2329.1019753830@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Daniel Lundin <daniel(at)helena-daniel(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ian Morgan 2002-04-25 17:04:22 Re: How to discover foreign keys (without pulling hair out)
Previous Message David Stanaway 2002-04-25 16:46:31 Re: SELECT in a function != SELECT ?