Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lys3v-0006sp-Vd for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jul 2021 08:28:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lys3u-0005ak-BO for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jul 2021 08:28:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lys3u-0005ab-3H for pgsql-hackers@lists.postgresql.org; Thu, 01 Jul 2021 08:28:42 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lys3p-00052k-3b for pgsql-hackers@postgresql.org; Thu, 01 Jul 2021 08:28:41 +0000 Received: from hnk.local (p2388012-ipbf1027funabasi.chiba.ocn.ne.jp [118.6.6.12]) by oss.nttdata.com (Postfix) with ESMTPSA id D5EE560299; Thu, 1 Jul 2021 17:28:30 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.2 at oss.nttdata.com Subject: Re: track_planning causing performance regression To: Julien Rouhaud , Justin Pryzby Cc: Pavel Stehule , Peter Geoghegan , "Tharakan, Robins" , pgsql-hackers References: <646e5cae-5e8b-feaa-43dc-014bf355bf08@oss.nttdata.com> <20210418233615.GB7256@telsasoft.com> <20210419145545.GF7256@telsasoft.com> <20210421145338.GT7256@telsasoft.com> <20210421154007.GU7256@telsasoft.com> <20210629020918.GE21248@telsasoft.com> <20210629024535.GG21248@telsasoft.com> From: Fujii Masao Message-ID: Date: Thu, 1 Jul 2021 17:28:30 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/06/30 0:12, Julien Rouhaud wrote: >> Enabling this parameter may incur a noticeable performance penalty, >> - especially when a fewer kinds of queries are executed on many >> - concurrent connections. >> + especially when queries with identical structure are executed by many >> + concurrent connections which compete to update a small number of >> + pg_stat_statements entries. >> >> It could say "identical structure" or "the same queryid" or "identical queryid". > > I think we should try to reuse the previous formulation. How about > "statements with identical query structure"? I'm fine with this. So what about the following diff? I added tag. pg_stat_statements.track_planning controls whether planning operations and duration are tracked by the module. Enabling this parameter may incur a noticeable performance penalty, - especially when a fewer kinds of queries are executed on many - concurrent connections. + especially when statements with identical query structure are executed + by many concurrent connections which compete to update a small number of + pg_stat_statements entries. The default value is off. Only superusers can change this setting. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION