X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B396BD72D2 for ; Mon, 17 Oct 2005 14:51:19 -0300 (ADT) 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 61661-04 for ; Mon, 17 Oct 2005 17:51:13 +0000 (GMT) Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by svr1.postgresql.org (Postfix) with ESMTP id C4925D70B4 for ; Mon, 17 Oct 2005 14:51:13 -0300 (ADT) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id B5CBC417ED7; Mon, 17 Oct 2005 18:50:21 +0100 (BST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 72E6315EDE; Mon, 17 Oct 2005 18:46:03 +0100 (BST) Received: from mainbox.archonet.com ([127.0.0.1]) by localhost (mainbox [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 28736-03; Mon, 17 Oct 2005 18:45:58 +0100 (BST) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id D2F7515EDA; Mon, 17 Oct 2005 18:45:38 +0100 (BST) Message-ID: <4353E342.2060708@archonet.com> Date: Mon, 17 Oct 2005 18:45:38 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Martin Nickel Cc: pgsql-performance@postgresql.org Subject: Re: Sequential scan on FK join References: <4353648C.8040507@archonet.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.059 required=5 tests=[AWL=0.009, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/255 X-Sequence-Number: 15023 Martin Nickel wrote: > Subject: Re: Sequential scan on FK join > From: Martin Nickel > Newsgroups: pgsql.performance > Date: Wed, 12 Oct 2005 15:53:35 -0500 > > Richard, here's the EXPLAIN ANALYZE. I see your point re: the 2.7M > expected vs the 2 actual, but I've run ANALYZE on the lead table and it > hasn't changed the plan. Suggestions? > > Hash Join (cost=62.13..2001702.55 rows=2711552 width=20) > (actual time=40.659..244709.315 rows=2 125270 loops=1) ^^^ Hmm - is that not just a formatting gap there? Is it not 2,125,270 rows matching which would suggest PG is getting it more right than wrong. Try issuing "SET enable_seqscan=false" before running the explain analyse - that will force the planner to use any indexes it can find and should show us whether the index would help. -- Richard Huxton Archonet Ltd