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 51085D6DB0 for ; Mon, 17 Oct 2005 09:58:09 -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 70220-07 for ; Mon, 17 Oct 2005 12:58:05 +0000 (GMT) Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id DBB1ED6FB5 for ; Mon, 17 Oct 2005 09:58:06 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 9C02B31058; Mon, 17 Oct 2005 14:58:10 +0200 (MET DST) From: Martin Nickel X-Newsgroups: pgsql.performance Subject: Re: Sequential scan on FK join Date: Mon, 17 Oct 2005 08:07:54 -0500 Organization: Hub.Org Networking Services Lines: 21 Message-ID: References: <4353648C.8040507@archonet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@news.hub.org User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200510/252 X-Sequence-Number: 15020 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)" " Hash Cond: ("outer".mailing_id = "inner".mailing_id)" " -> Seq Scan on lead l (cost=0.00..1804198.60 rows=34065260 width=8) (actual time=8.621..180281.094 rows=34060373 loops=1)" " -> Hash (cost=61.22..61.22 rows=362 width=20) (actual time=28.718..28.718 rows=0 loops=1)" " -> Index Scan using mailing_maildate_idx on mailing m (cost=0.00..61.22 rows=362 width=20) (actual time=16.571..27.793 rows=430 loops=1)" " Index Cond: ((maildate >= '2005-07-01'::date) AND (maildate < '2005-08-01'::date))" "Total runtime: 248104.339 ms"