Andrew Koshelev <andrew(at)sgg(dot)ru> writes:
> As you can see, optimizer in earlier version of PostgreSQL skips
> unneeded data, but latest version doesn't.
CVS tip works the way you want it to. The behavior in 7.3.* is an
unfortunate side-effect of a quick-and-dirty bug fix. The less dirty
way to fix it is in CVS tip but was deemed too risky to backpatch
into 7.3.*.
regards, tom lane