Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gReqY-0003ac-2W for pgsql-performance@arkaria.postgresql.org; Tue, 27 Nov 2018 15:00:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gReqW-0002PL-Sd for pgsql-performance@arkaria.postgresql.org; Tue, 27 Nov 2018 15:00:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gReqW-0002P7-HX for pgsql-performance@lists.postgresql.org; Tue, 27 Nov 2018 15:00:16 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gReqQ-00075l-Ag for pgsql-performance@lists.postgresql.org; Tue, 27 Nov 2018 15:00:15 +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 wARF08sY000795; Tue, 27 Nov 2018 10:00:08 -0500 From: Tom Lane To: Sanyo Moura cc: pgsql-performance@lists.postgresql.org Subject: Re: Query with high planning time at version 11.1 compared versions 10.5 and 11.0 In-reply-to: References: Comments: In-reply-to Sanyo Moura message dated "Tue, 27 Nov 2018 12:16:41 -0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <792.1543330808.1@sss.pgh.pa.us> Date: Tue, 27 Nov 2018 10:00:08 -0500 Message-ID: <793.1543330808@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Sanyo Moura writes: > And below are the times generated by EXPLAIN ANALYZE: > 10.5 > Planning time: 126.080 ms > Execution time: 2.306 ms > 11.0 > Planning Time: 7.238 ms > Planning Time: 2.638 ms > 11.5 (I assume you mean 11.1 here) > Planning Time: 15138.533 ms > Execution Time: 2.310 ms There were no changes between 11.0 and 11.1 that look like they'd affect planning time. Nor does it seem particularly credible that planning time would have dropped by a factor of 15 between 10.x and 11.x, especially not given that the resulting plan didn't change. I think you've got some external factor causing long planning times --- maybe something taking an exclusive lock on one of the tables, or on pg_statistic? regards, tom lane