X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9EAC48B9D1A for ; Mon, 14 Feb 2005 03:38:08 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80807-04 for ; Mon, 14 Feb 2005 03:38:04 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 8BA858B9D11 for ; Mon, 14 Feb 2005 03:38:03 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j1E3c16D019675; Sun, 13 Feb 2005 22:38:01 -0500 (EST) To: Jaime Casanova Cc: Josh Berkus , performance pgsql Subject: Re: estimated rows vs. actual rows In-reply-to: References: <200502131341.09811.josh@agliodbs.com> Comments: In-reply-to Jaime Casanova message dated "Sun, 13 Feb 2005 22:18:52 -0500" Date: Sun, 13 Feb 2005 22:38:01 -0500 Message-ID: <19674.1108352281@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/203 X-Sequence-Number: 10532 Jaime Casanova 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