pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Kirkwood <markir@coretech.co.nz>
To: Jaime Casanova <systemguards@gmail.com>
Cc: performance pgsql <pgsql-performance@postgresql.org>
Subject: Re: estimated rows vs. actual rows
Date: Mon, 14 Feb 2005 16:45:58 +1300
Message-ID: <42101EF6.8010403@coretech.co.nz> (raw)
In-Reply-To: <c2d9e70e05021319182db34831@mail.gmail.com>
References: <c2d9e70e0502131327c95e63d@mail.gmail.com>
	<200502131341.09811.josh@agliodbs.com>
	<c2d9e70e05021319182db34831@mail.gmail.com>

Jaime Casanova wrote:
> 
> But, IMHO, if the table has 143902 and it thinks will retrieve 2610
> (almost 1.81% of the total). it won't be faster with an index?
> 

Depends on how those 2610 rows are distributed amongst the 143902. The 
worst case scenario is each one of them in its own page. In that case 
you have to read 2610 *pages*, which is probably a significant 
percentage of the table.

You can find out this information from the pg_stats view (particularly 
the correlation column).


Mark



view thread (6+ messages)  latest in thread

Message-ID: <42101EF6.8010403@coretech.co.nz>
Permalink:  ../42101EF6.8010403@coretech.co.nz/
Also on:    postgresql.org/message-id/42101EF6.8010403@coretech.co.nz

 · 

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: markir@coretech.co.nz, systemguards@gmail.com
  Subject: Re: estimated rows vs. actual rows
  In-Reply-To: <42101EF6.8010403@coretech.co.nz>

* 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