Re: estimated rows vs. actual rows - Mailing list pgsql-performance

From Tom Lane
Subject Re: estimated rows vs. actual rows
Date
Msg-id 19674.1108352281@sss.pgh.pa.us
Whole thread Raw
In response to Re: estimated rows vs. actual rows  (Jaime Casanova <systemguards@gmail.com>)
List pgsql-performance
Jaime Casanova <systemguards@gmail.com> writes:
> 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?

That's almost one row in fifty.  We don't know how wide the table is,
but it's certainly possible that there are order-of-a-hundred rows
on each page; in which case the indexscan is likely to hit every page.
Twice.  Not in sequence.  Only if the selected rows are pretty well
clustered in a small part of the table is this going to be a win
over a seqscan.

            regards, tom lane

pgsql-performance by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: estimated rows vs. actual rows
Next
From: Mark Kirkwood
Date:
Subject: Re: estimated rows vs. actual rows