Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 24B3D632440 for ; Sun, 28 Mar 2010 06:40:15 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 39142-03 for ; Sun, 28 Mar 2010 09:39:56 +0000 (UTC) X-Greylist: delayed 00:12:48.701031 by SQLgrey-1.7.6 Received: from gpdnet.co.uk (gpdnet.plus.com [212.56.100.243]) by mail.postgresql.org (Postfix) with SMTP id 21FF2634131 for ; Sun, 28 Mar 2010 06:40:00 -0300 (ADT) Received: (qmail 8554 invoked by uid 453); 23 Mar 2010 15:47:46 -0000 Received: from pc-00002.gpdnet.co.uk (HELO [192.168.1.2]) (192.168.1.2) by gpdnet.co.uk (qpsmtpd/0.40) with ESMTP; Tue, 23 Mar 2010 15:47:46 +0000 Message-ID: <4BAF20FA.30800@gpdnet.co.uk> Date: Sun, 28 Mar 2010 10:27:22 +0100 From: Gary Doades User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Optimizer showing wrong rows in plan References: <645d9d71003272351x766707c7sadde9aa77bc1c0d3@mail.gmail.com> <645d9d71003280011q6cf2c6d6p7279605e6e0b4235@mail.gmail.com> <645d9d71003280033l16069edcp45d9bbb0e7ed5517@mail.gmail.com> <4BAF14F2.20200@gpdnet.co.uk> <645d9d71003280207p14fa4628i91b51ca8ee954216@mail.gmail.com> In-Reply-To: <645d9d71003280207p14fa4628i91b51ca8ee954216@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.224 tagged_above=-10 required=5 tests=AWL=1.224, BAYES_50=0.001 X-Spam-Level: * X-Archive-Number: 201003/356 X-Sequence-Number: 38181 On 28/03/2010 10:07 AM, Tadipathri Raghu wrote: > 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. Like I said, it's just a guess. With no statistics all postgres can do is guess, or in this case use the in-built default for a newly created table. It could guess 1 or it could guess 10,000,000. What it does is produce a reasonable guess in the absence of any other information. You should read the postgres documentation for further information about statistics and how the optimizer uses them. Regards, Gary.