Skip site navigation (1) Skip section navigation (2)

Re: estimated rows vs. actual rows

From: Mark Kirkwood <markir(at)coretech(dot)co(dot)nz>
To: Jaime Casanova <systemguards(at)gmail(dot)com>
Cc: performance pgsql <pgsql-performance(at)postgresql(dot)org>
Subject: Re: estimated rows vs. actual rows
Date: 2005-02-14 03:45:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
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).


In response to

pgsql-performance by date

Next:From: Hasnul Fadhly bin HasanDate: 2005-02-14 08:01:20
Subject: Autocommit
Previous:From: Tom LaneDate: 2005-02-14 03:38:01
Subject: Re: estimated rows vs. actual rows

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group