Re: Bug #4284

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David Rowley" <dgrowley(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bug #4284
Date: 2009-02-11 23:18:30
Message-ID: 22820.1234394310@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David Rowley" <dgrowley(at)gmail(dot)com> writes:
> I thought about this after sending my reply to this last night. I remembered
> when I created my test case I had to add the other tables to get the nest
> loop behaviour. I'm not sure your guess about the multicolumn selectivity
> issue is correct. I re-tested with the following query.
> ...
> Perfect row estimate!

The reason for that is that the planner knows that a LEFT JOIN result
can't be smaller than the left input, so whatever join size estimate it
comes up with from statistics will be clamped to be at least that much.
If you change the test case to an inner join you still get the one-row
rowcount estimate, same as for the join to t2.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-02-11 23:31:11 Re: Strange issue with CREATE OPERATOR CLASS
Previous Message Josh Berkus 2009-02-11 23:12:35 Re: A deprecation policy