Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id F298B633921 for ; Sun, 28 Mar 2010 04:29:58 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 93576-02 for ; Sun, 28 Mar 2010 07:29:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ww0-f46.google.com (mail-ww0-f46.google.com [74.125.82.46]) by mail.postgresql.org (Postfix) with ESMTP id 3B07A632D83 for ; Sun, 28 Mar 2010 04:29:48 -0300 (ADT) Received: by wwe15 with SMTP id 15so7564365wwe.19 for ; Sun, 28 Mar 2010 00:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=4PaQFYa5nuy/46L0N8j2JU78KDbtSe+KCNS2P/bmoGg=; b=LJyAHIoN3i+LNaV/4iM8+tV9ehRAmjLr75hb7SpA03kvG5UdDT6TwEg0Eb6yUoUZRd JMXXmeieatlaqE6r7rGC3l2n8gDaGzI90+LYO1J7nJXPsRQ9/8aw3CwZ4J1njx8DgrBG Zd4BSTDzSWxeYzpJBa/Z4fIyTnJnkwiVvZGjY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=SGAXR00iBkp9p9ZY/MaeNj0n4xvfwFwr6y/Grue7rKJZhSHLEPUMXqI2zYzRMjdPrv Jso+i3pUfuxLR48Y5soZmKrcCYqGFB63NgiEzX95uekigzJKev7+AkJQEziuDUPDKYb4 5PrsNpcVSSBGEzDDB6GlTLaTLmVsM1G9O8zG8= MIME-Version: 1.0 Received: by 10.216.0.5 with HTTP; Sun, 28 Mar 2010 00:29:46 -0700 (PDT) In-Reply-To: <645d9d71003280011q6cf2c6d6p7279605e6e0b4235@mail.gmail.com> References: <645d9d71003272351x766707c7sadde9aa77bc1c0d3@mail.gmail.com> <645d9d71003280011q6cf2c6d6p7279605e6e0b4235@mail.gmail.com> Date: Sun, 28 Mar 2010 09:29:46 +0200 Received: by 10.216.88.4 with SMTP id z4mr1966507wee.121.1269761386770; Sun, 28 Mar 2010 00:29:46 -0700 (PDT) Message-ID: Subject: Re: Optimizer showing wrong rows in plan From: Szymon Guz To: Tadipathri Raghu Cc: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=0016e6d99efa6871bd0482d75c13 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201003/352 X-Sequence-Number: 38177 --0016e6d99efa6871bd0482d75c13 Content-Type: text/plain; charset=UTF-8 2010/3/28 Tadipathri Raghu > Hi Guz, > > Thank you for the prompt reply. > > >> No, the optimizer is not retrieving anything, it just assumes that there >> are 2400 rows because that is the number of rows that exists in the >> statictics for this table. The optimizer just tries to find the best plan >> and to optimize the query plan for execution taking into consideration all >> information that can be found for this table (it also looks in the >> statistics information about rows from this table). > > > So, whats it assuming here as rows(2400). Could you explain this. > > > It is assuming that there are 2400 rows in this table. Probably you've deleted some rows from the table leaving just one. regards Szymon Guz --0016e6d99efa6871bd0482d75c13 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

2010/3/28 Tadipathri Raghu <traghu.dba@gmail.com&g= t;
Hi=C2=A0Guz,
=C2=A0
Thank you for the prompt reply.
=C2=A0
No, the optimizer is not retrieving a= nything, it just assumes that there are 2400 rows because that is the numbe= r of rows that exists in the statictics for this table. The optimizer just = tries to find the best plan and to optimize the query plan for execution ta= king into consideration all information that can be found for this table (i= t also looks in the statistics information about rows from this table).
=C2=A0
So, whats it assuming here as rows(2400).=C2=A0 Could you explai= n this.
=C2=A0


It is assuming that there a= re 2400 rows in this table. Probably you've deleted some rows from the = table leaving just one.

regards
Szymon Guz=C2= =A0

--0016e6d99efa6871bd0482d75c13--