Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a4aMs-0003On-Sk for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Dec 2015 20:20:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a4aMs-0000IK-EA for pgsql-bugs@arkaria.postgresql.org; Thu, 03 Dec 2015 20:20:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a4aMG-0007oo-6r for pgsql-bugs@postgresql.org; Thu, 03 Dec 2015 20:20:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a4aM8-000645-3R for pgsql-bugs@postgresql.org; Thu, 03 Dec 2015 20:20:03 +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 tB3KJlED025315; Thu, 3 Dec 2015 15:19:48 -0500 From: Tom Lane To: ydolgikh@jerasoft.net cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13792: Weird querry planner behavior In-reply-to: <20151203160644.5889.21946@wrigleys.postgresql.org> References: <20151203160644.5889.21946@wrigleys.postgresql.org> Comments: In-reply-to ydolgikh@jerasoft.net message dated "Thu, 03 Dec 2015 16:06:44 +0000" Date: Thu, 03 Dec 2015 15:19:47 -0500 Message-ID: <25314.1449173987@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org ydolgikh@jerasoft.net writes: > This query takes around 35 seconds to run when used in the production > environment ("clients" has about 1 million records). However, if I take out > ANY join - the query will take only about 300 ms to execute. Offhand I'd guess that increasing join_collapse_limit (and possibly also from_collapse_limit) would help. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs