Re: Optimizer showing wrong rows in plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tadipathri Raghu <traghu(dot)dba(at)gmail(dot)com>
Cc: Szymon Guz <mabewlun(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Optimizer showing wrong rows in plan
Date: 2010-03-28 16:27:41
Message-ID: 22618.1269793661@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tadipathri Raghu <traghu(dot)dba(at)gmail(dot)com> writes:
> Frankly speaking its a newly created table without any operation on it as
> you have seen the example. Then how come it showing those many rows where we
> have only one in it.

Yes. This is intentional: the size estimates for a never-yet-analyzed
table are *not* zero. This is because people frequently create and load
up a table and then immediately query it without an explicit ANALYZE.
The quality of the plans you'd get at that point (especially for joins)
would be spectacularly bad if the default assumption were that the table
was very small.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jeremy Harris 2010-03-28 17:08:45 Re: Optimizer showing wrong rows in plan
Previous Message Gary Doades 2010-03-28 09:27:22 Re: Optimizer showing wrong rows in plan