X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D9464D1E14F for ; Thu, 22 Apr 2004 23:03:12 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 16770-03 for ; Thu, 22 Apr 2004 23:03:15 -0300 (ADT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id B6A64D1E147 for ; Thu, 22 Apr 2004 23:03:09 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i3N23Cav014460; Thu, 22 Apr 2004 22:03:12 -0400 (EDT) To: Sean Shanny Cc: pgsql-performance@postgresql.org Subject: Re: Looking for ideas on how to speed up warehouse loading In-reply-to: <40883FAB.3070109@earthlink.net> References: <40883FAB.3070109@earthlink.net> Comments: In-reply-to Sean Shanny message dated "Thu, 22 Apr 2004 17:56:59 -0400" Date: Thu, 22 Apr 2004 22:03:12 -0400 Message-ID: <14459.1082685792@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/399 X-Sequence-Number: 6699 Sean Shanny writes: > explain analyze SELECT t1.id, t2.url FROM referral_temp t2 LEFT OUTER > JOIN d_referral t1 ON t2.url = t1.referral_raw_url ORDER BY t1.id; > QUERY PLAN > ------------------------------------------------------------------------------------------------------------------------------------------------------ > Sort (cost=4012064.81..4013194.45 rows=451856 width=115) (actual > time=1297320.823..1297739.813 rows=476176 loops=1) > Sort Key: t1.id > -> Hash Left Join (cost=1052345.95..3969623.10 rows=451856 > width=115) (actual time=1146650.487..1290230.590 rows=476176 loops=1) > Hash Cond: ("outer".url = "inner".referral_raw_url) > -> Seq Scan on referral_temp t2 (cost=0.00..6645.56 > rows=451856 width=111) (actual time=20.285..1449.634 rows=476176 loops=1) > -> Hash (cost=729338.16..729338.16 rows=46034716 width=124) > (actual time=1146440.710..1146440.710 rows=0 loops=1) > -> Seq Scan on d_referral t1 (cost=0.00..729338.16 > rows=46034716 width=124) (actual time=14.502..-1064277.123 rows=46034715 > loops=1) > Total runtime: 1298153.193 ms > (8 rows) > What I would like to know is if there are better ways to do the join? What have you got sort_mem set to? You might try increasing it to a gig or so, since you seem to have plenty of RAM in that box ... regards, tom lane