> (3) is an instance of seeing "a = b and b = c" and deducing "a = c" from
> that. (4) does not follow that pattern, so it's outside the realm of what
the
> planner can deduce.
I see, that makes sense. I assumed there was something more complex going
on in
the background. What about converting (1) into (2)? I know the planner does
something kind of similar, in converting
SELECT * FROM (SELECT * FROM x WHERE a) WHERE b
into
SELECT * FROM (SELECT * FROM x WHERE a AND b)
I guess in this case it would have to know about unique indexes to prove
that
if the primary keys are equal, all the other columns are too. My intention
in
trying (3) was to take that burden of proof off the planner.