pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary Doades <gpd@gpdnet.co.uk>
To: pgsql-performance@postgresql.org
Subject: Re: Optimizer showing wrong rows in plan
Date: Sun, 28 Mar 2010 10:27:22 +0100
Message-ID: <4BAF20FA.30800@gpdnet.co.uk> (raw)
In-Reply-To: <645d9d71003280207p14fa4628i91b51ca8ee954216@mail.gmail.com>
References: <645d9d71003272351x766707c7sadde9aa77bc1c0d3@mail.gmail.com>
	<e4edc9361003280002o627b710dhe89c98c18b5d1db3@mail.gmail.com>
	<645d9d71003280011q6cf2c6d6p7279605e6e0b4235@mail.gmail.com>
	<e4edc9361003280029v7174f84bo72d073aced772206@mail.gmail.com>
	<645d9d71003280033l16069edcp45d9bbb0e7ed5517@mail.gmail.com>
	<4BAF14F2.20200@gpdnet.co.uk>
	<645d9d71003280207p14fa4628i91b51ca8ee954216@mail.gmail.com>

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.





view thread (15+ messages)  latest in thread

Message-ID: <4BAF20FA.30800@gpdnet.co.uk>
Permalink:  ../4BAF20FA.30800@gpdnet.co.uk/
Also on:    postgresql.org/message-id/4BAF20FA.30800@gpdnet.co.uk

 · 

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: gpd@gpdnet.co.uk
  Subject: Re: Optimizer showing wrong rows in plan
  In-Reply-To: <4BAF20FA.30800@gpdnet.co.uk>

* 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