pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tadipathri Raghu <traghu.dba@gmail.com>
Cc: Szymon Guz <mabewlun@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Optimizer showing wrong rows in plan
Date: Sun, 28 Mar 2010 12:27:41 -0400
Message-ID: <22618.1269793661@sss.pgh.pa.us> (raw)
In-Reply-To: <645d9d71003280033l16069edcp45d9bbb0e7ed5517@mail.gmail.com>
References: <645d9d71003272351x766707c7sadde9aa77bc1c0d3@mail.gmail.com>
	<e4edc9361003280002o627b710dhe89c98c18b5d1db3@mail.gmail.com>
	<645d9d71003280011q6cf2c6d6p7279605e6e0b4235@mail.gmail.com>
	<e4edc9361003280029v7174f84bo72d073aced772206@mail.gmail.com>
	<645d9d71003280033l16069edcp45d9bbb0e7ed5517@mail.gmail.com>

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



view thread (15+ messages)  latest in thread

Message-ID: <22618.1269793661@sss.pgh.pa.us>
Permalink:  ../22618.1269793661@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22618.1269793661@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, traghu.dba@gmail.com, mabewlun@gmail.com
  Subject: Re: Optimizer showing wrong rows in plan
  In-Reply-To: <22618.1269793661@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox