Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yd0rA-0007be-Az for pgsql-bugs@arkaria.postgresql.org; Tue, 31 Mar 2015 18:25:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yd0r9-00086s-Px for pgsql-bugs@arkaria.postgresql.org; Tue, 31 Mar 2015 18:25:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yd0r9-00086e-3d for pgsql-bugs@postgresql.org; Tue, 31 Mar 2015 18:25:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yd0r5-0002rU-Ln for pgsql-bugs@postgresql.org; Tue, 31 Mar 2015 18:25:42 +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 t2VIPbua023075; Tue, 31 Mar 2015 14:25:37 -0400 From: Tom Lane To: maxim.boguk@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12933: Custom prepared plan vs partitioning. In-reply-to: <20150331172329.2563.85270@wrigleys.postgresql.org> References: <20150331172329.2563.85270@wrigleys.postgresql.org> Comments: In-reply-to maxim.boguk@gmail.com message dated "Tue, 31 Mar 2015 17:23:29 -0000" Date: Tue, 31 Mar 2015 14:25:37 -0400 Message-ID: <23074.1427826337@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 maxim.boguk@gmail.com writes: > I found case when custom plans with partitioning shows strange behavior. > First 5 repetitions of execute with the same parameters I getting fast > custom plan, on 6th run plan switch to slow generic (all-partitions) > version. This behavior is expected; after half a dozen trials the plancache will decide it's not getting enough win from custom plans to justify replanning every time. For a cost delta of about 0.6 unit I would have to agree with it. You may have a real case where it's doing something wrong, but this toy example doesn't demonstrate a bug IMO. 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