"Matt Klinker" <mklinker(at)gmail(dot)com> writes:
> I know it's generally requested to include the EXPLAIN text when submitting
> a specific question, but I thought perhaps this was generic enough that
> someone might at least have some suggestions.
You're usually only going to get generic suggestions from a generic
explanation.
One thought here though is that it's only been since PG 8.2 that you had
any hope of getting an indexscan on a join condition pushed down through
a UNION, which it looks like is what you're hoping for. What version
are you running?
regards, tom lane