Re: Optimizer oddness, possibly compounded in 8.1

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Philip Warner <pjw@rhyme.com.au>
Cc: pgsql-hackers@postgresql.org
Date: 2005-12-02T15:42:48Z
Lists: pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> The optimizer seems to want to use sequential scans on inherited tables
> when crossed with another table, as the following seems to demonstrate:

Is it intentional that your test case omits an analyze on t2?  Coz when
I add that, I get the same plan you show for 8.0.  Without the knowledge
that t2 is small, that plan is not a good choice.

(The larger point that joins of inheritance unions aren't well-planned
is true, but it's always been true...)

			regards, tom lane