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

From Tadipathri Raghu
Subject Re: Optimizer showing wrong rows in plan
Date
Msg-id 645d9d71003280207p14fa4628i91b51ca8ee954216@mail.gmail.com
Whole thread Raw
In response to Optimizer showing wrong rows in plan  (Tadipathri Raghu <traghu.dba@gmail.com>)
Responses Re: Optimizer showing wrong rows in plan
Re: Optimizer showing wrong rows in plan
List pgsql-performance
Hi All,
 
I want to give some more light on this by analysing more like this
 
1. In my example I have created a table with one column as INT( which occupies 4 bytes)
2. Initially it occupies one page of  space on the file that is (8kb).
 
So, here is it assuming these many rows may fit in this page. Clarify me on this Please.
 
Regards
Raghavendra

 
On Sun, Mar 28, 2010 at 2:06 PM, Gary Doades <gpd@gpdnet.co.uk> wrote:
On 28/03/2010 8:33 AM, Tadipathri Raghu wrote:
Hi Guz,
 
It is assuming that there are 2400 rows in this table. Probably you've deleted some rows from the table leaving just one.
 
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.
Thanks if we have proper explination on this..
It's not *showing* any rows at all, it's *guessing* 2400 rows because you've never analyzed the table. Without any statistics at all, postgres will use some form of in-built guess for a table that produces reasonable plans under average conditions. As you've already seen, once you analyze the table, the guess get's much  better and therefore would give you a more appropriate plan.

Regards,
Gary.


pgsql-performance by date:

Previous
From: Tadipathri Raghu
Date:
Subject: Re: Optimizer showing wrong rows in plan
Next
From: Frank Heikens
Date:
Subject: Re: Optimizer showing wrong rows in plan