Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjoK7-0003hP-VT for pgsql-performance@arkaria.postgresql.org; Mon, 12 May 2014 11:23:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WjoK7-00048y-A7 for pgsql-performance@arkaria.postgresql.org; Mon, 12 May 2014 11:23:11 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjoK6-00048r-4H for pgsql-performance@postgresql.org; Mon, 12 May 2014 11:23:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WjoJy-0000az-2l for pgsql-performance@postgresql.org; Mon, 12 May 2014 11:23:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s4CBN03i017740; Mon, 12 May 2014 07:23:00 -0400 From: Tom Lane To: Tim Kane cc: "pgsql-performance@postgresql.org" Subject: Re: 9.2.4 vs 9.3.0 query planning (sort merge join vs hash join) In-reply-to: References: Comments: In-reply-to Tim Kane message dated "Mon, 12 May 2014 11:45:20 +0100" Date: Mon, 12 May 2014 07:23:00 -0400 Message-ID: <17739.1399893780@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Tim Kane writes: > Is there a propensity for 9.2.4 to prefer a sort-merge-join, in place of a > hash join? Not particularly; I don't think there's any actual difference in the cost estimation equations between 9.2 and 9.3. The two plans you show are close enough in estimated cost that the ordering of their costs might be coming out differently just as a matter of random variation in statistics. It'd be worth double-checking the work_mem setting on both systems, though, as (IIRC) an undersized work_mem hurts the estimate for hashes more than for sorts. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance