Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> I *think* 7.4 may be smarter about
> implying these conditions as well.
Not really. AFAIR the Append-style plan is the only thing you can get
out of the planner for inheritance trees. This works well enough for
restriction clauses like "id = constant" (since those get pushed down to
the member tables, much as with UNION ALL), but it just isn't gonna be
efficient for join situations. And I can't see any realistic way for
the planner to realize that only some pairs of child tables need be
joined.
I think the decision to use an inheritance tree for performance reasons
(as opposed to any logical necessity) was probably not a good one.
It'd be better to store all the data in one big table and use partial
indexes for faster access to subsets.
regards, tom lane