Robert Haas <robertmhaas@gmail.com> writes:
> A more interesting question is why you're not getting a plan like this:
> Nested Loop
> -> Seq Scan on objects
> -> Append
> -> Index Scan using xxx_pkey on itemXX
> -> Index Scan using yyy_pkey on itemYY
> -> Index Scan using zzz_pkey on itemZZ
Probably because there are 4 million rows in the objects table.
Or maybe it's a pre-8.2 database and can't even generate such a plan.
But if it did generate it, it would almost certainly have decided that
this was more expensive than a hash or merge join.
People have this weird idea that the existence of an index ought to make
enormous joins free ...
regards, tom lane