Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsiIc-0007de-Jh for pgsql-performance@arkaria.postgresql.org; Tue, 17 Dec 2013 00:14:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VsiIc-0001WU-4A for pgsql-performance@arkaria.postgresql.org; Tue, 17 Dec 2013 00:14:10 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsiIa-0001WN-Tu for pgsql-performance@postgresql.org; Tue, 17 Dec 2013 00:14:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsiIY-0004rD-7t for pgsql-performance@postgresql.org; Tue, 17 Dec 2013 00:14:08 +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 rBH0E5iU018829; Mon, 16 Dec 2013 19:14:05 -0500 From: Tom Lane To: Joe Van Dyk cc: "pgsql-performance@postgresql.org" Subject: Re: Adding an additional join causes very different/slow query plan In-reply-to: References: Comments: In-reply-to Joe Van Dyk message dated "Mon, 16 Dec 2013 13:59:35 -0800" Date: Mon, 16 Dec 2013 19:14:05 -0500 Message-ID: <18828.1387239245@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) 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 Joe Van Dyk writes: > Hm, setting set join_collapse_limit = 9 seemed to fix the problem. Is that > my best/only option? Yup, that's what I was just about to suggest. You might want to use 10 or 12 in case some of your queries are a bit more complex than this one --- but don't go overboard, or you may find yourself with unreasonable planning time. 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