Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group