Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 692009FB5D3 for ; Fri, 25 May 2007 17:34:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 24373-02 for ; Fri, 25 May 2007 17:33:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 99A209FB5AE for ; Fri, 25 May 2007 17:33:56 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l4PKXkbY021465; Fri, 25 May 2007 16:33:46 -0400 (EDT) To: "Steinar H. Gunderson" cc: pgsql-performance@postgresql.org Subject: Re: Performance problem on 8.2.4, but not 8.2.3 In-reply-to: <20070525200523.GA15547@uio.no> References: <2C91A79B-6AFD-4734-B245-2ED81F4F15D4@mediamatters.org> <21071.1180122995@sss.pgh.pa.us> <20070525200523.GA15547@uio.no> Comments: In-reply-to "Steinar H. Gunderson" message dated "Fri, 25 May 2007 22:05:23 +0200" Date: Fri, 25 May 2007 16:33:46 -0400 Message-ID: <21464.1180125226@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/539 X-Sequence-Number: 24929 "Steinar H. Gunderson" writes: > It looks like the estimated cost is lower for 8.2.4 -- could it be that the > fact that he's giving it more memory lead to the planner picking a plan that > happens to be worse? Offhand I don't think so. More work_mem might make a hash join look cheaper (or a sort for a mergejoin), but the problem here seems to be that it's switching away from a hash and to a nestloop. Which is a loser because there are many more outer-relation rows than it's expecting. regards, tom lane