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 DB0F2D1E17E for ; Fri, 16 Apr 2004 13:34:14 -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 90550-02 for ; Fri, 16 Apr 2004 13:34:09 -0300 (ADT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0B994D1DB0A for ; Fri, 16 Apr 2004 13:34:13 -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 i3GGYBfq000451; Fri, 16 Apr 2004 12:34:12 -0400 (EDT) To: "Jim C. Nasby" Cc: pgsql-performance@postgresql.org Subject: Re: Horribly slow hash join In-reply-to: <20040416154502.GF87362@nasby.net> References: <20040416154502.GF87362@nasby.net> Comments: In-reply-to "Jim C. Nasby" message dated "Fri, 16 Apr 2004 10:45:02 -0500" Date: Fri, 16 Apr 2004 12:34:11 -0400 Message-ID: <450.1082133251@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/213 X-Sequence-Number: 6513 "Jim C. Nasby" writes: > Note the time for the hash join step: Have you ANALYZEd these tables lately? It looks to me like it's hashing on some column that has only a small number of distinct values, so that the hash doesn't actually help to avoid comparisons. The planner should know better than to choose such a plan, but if it's working with obsolete stats ... regards, tom lane