Re: Optimizer showing wrong rows in plan - Mailing list pgsql-performance

From Tom Lane
Subject Re: Optimizer showing wrong rows in plan
Date
Msg-id 22618.1269793661@sss.pgh.pa.us
Whole thread Raw
In response to Re: Optimizer showing wrong rows in plan  (Tadipathri Raghu <traghu.dba@gmail.com>)
Responses Re: Optimizer showing wrong rows in plan
List pgsql-performance
Tadipathri Raghu <traghu.dba@gmail.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

pgsql-performance by date:

Previous
From: Gary Doades
Date:
Subject: Re: Optimizer showing wrong rows in plan
Next
From: Jeremy Harris
Date:
Subject: Re: Optimizer showing wrong rows in plan