X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 8AADA9FB35E for ; Mon, 31 Jul 2006 11:29:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 94124-02 for ; Mon, 31 Jul 2006 11:29:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 268389FB33A for ; Mon, 31 Jul 2006 11:28:57 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k6VESkT4014464; Mon, 31 Jul 2006 10:28:46 -0400 (EDT) To: H Hale cc: pgsql-performance@postgresql.org Subject: Re: sub select performance due to seq scans In-reply-to: <20060731141427.87706.qmail@web88002.mail.re2.yahoo.com> References: <20060731141427.87706.qmail@web88002.mail.re2.yahoo.com> Comments: In-reply-to H Hale message dated "Mon, 31 Jul 2006 10:14:27 -0400" Date: Mon, 31 Jul 2006 10:28:46 -0400 Message-ID: <14463.1154356126@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.082 tagged_above=0 required=5 tests=AWL, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: ** X-Archive-Number: 200607/311 X-Sequence-Number: 20171 H Hale writes: > -> Bitmap Heap Scan on flatomfilesysentry (cost=2.00..274.38 rows=3238 width=30) (actual time=0.011..0.013 rows=1 loops=6473) > Recheck Cond: (flatomfilesysentry.objectid = "outer".dstobj) > -> Bitmap Index Scan on flatomfilesysentry_pkey (cost=0.00..2.00 rows=3238 width=0) (actual time=0.007..0.007 rows=1 loops=6473) > Index Cond: (flatomfilesysentry.objectid = "outer".dstobj) Well, there's our estimation failure: 3238 rows expected, one row actual. What is the data distribution of flatomfilesysentry.objectid? It looks from this example like it is unique or nearly so, but the planner evidently does not think that. regards, tom lane