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 1ly3Br-0007rd-Pz for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 02:09:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ly3Bp-0006nI-GP for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Jun 2021 02:09:29 +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 1ly3Bp-0006n9-62 for pgsql-hackers@lists.postgresql.org; Tue, 29 Jun 2021 02:09:29 +0000 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ly3Bj-0002rW-1j for pgsql-hackers@postgresql.org; Tue, 29 Jun 2021 02:09:28 +0000 Received: by mail-io1-xd36.google.com with SMTP id s19so24775160ioc.3 for ; Mon, 28 Jun 2021 19:09:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mAu8yP1Fos3aKg+dQxzD7QcwnAWPaDtsmxmUBEg62T0=; b=jQMr90fDSxyrjAm6Vk1BGUO13JIklKezI8P25JLkxtkxbrTWy/SmLr9AbEYKfsjl0k Osm8kB5JU4FfzbCIAI0FQwGw8ENeDbjPXUF5VGt+hKpiNJTV4BGzL8NiDjj49b6NCwo5 1E/dd4wlICITI1rkwSWmNN7S/iVq/4tYC9ihscIB7qmZQK6RuSkSu1YakzhhXjUeVk4W 16A7MOMU2Xo3WiUITVKz5OQ4DQhiQe2erMzkpqxeSbQv/CACCi4Ssz+4+7nr/vZYTwBy AZ6n+9X+v+Wu0D/c4iRoEEjDVW/Seboy2JoqiEeJMWp4FnUOJfvAZXC0Xpdv6l3Lp169 gxLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mAu8yP1Fos3aKg+dQxzD7QcwnAWPaDtsmxmUBEg62T0=; b=ApgrES7IQJUQVPfHCU1/TlFRoHeHhctx53ghkDhE+Q9H7d5Mq5MUoIb/PewYo24Fkz 6QNRIR4klObNUfBNcJ+Zx4aWlHefJMom/qXEC4ZK7IJVITLK9mHEVUvWyzcEtAsSnYuw PecVMqOb8rDXMkYRQaXi9JAM+n7fTz1+lSEua4zNJUanhEK3+gkmrjAPEWzZfc19luaL puYyJC+RnOoWQD24XsKL30ctQ13y02A3r5BMNnxQ1K7oS7owQNT7z4F45oyZWmrusBEc Px/OEpNOIbIhST1Q9cwu97K4cbDulTeaQvyFODIKM4oCUuIO3ZpxQePYEs8Uzr4QMWOa yNCQ== X-Gm-Message-State: AOAM530CGEMh3FADQv7jwrwfvTBGIS51M5sxzTA5FgnCLy2gHNYxVKpT rEyi65/JFh7c2YhiUqqbHdnhOw== X-Google-Smtp-Source: ABdhPJxJLn/e6gS5KB0VboNUWD+gj3912LBVAx9Rg4vK6M1GOaNp0ByJMRlyFo5oOoguH6DXNS73xg== X-Received: by 2002:a02:94af:: with SMTP id x44mr2125679jah.79.1624932560252; Mon, 28 Jun 2021 19:09:20 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id w7sm9784899ilu.74.2021.06.28.19.09.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jun 2021 19:09:19 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 5C499800AE5; Mon, 28 Jun 2021 21:09:18 -0500 (CDT) Date: Mon, 28 Jun 2021 21:09:18 -0500 From: Justin Pryzby To: Fujii Masao Cc: Pavel Stehule , Peter Geoghegan , Julien Rouhaud , "Tharakan, Robins" , pgsql-hackers@postgresql.org Subject: Re: track_planning causing performance regression Message-ID: <20210629020918.GE21248@telsasoft.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210421154007.GU7256@telsasoft.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Apr 21, 2021 at 10:40:07AM -0500, Justin Pryzby wrote: > On Thu, Apr 22, 2021 at 12:13:17AM +0900, Fujii Masao wrote: > > On 2021/04/21 23:53, Justin Pryzby wrote: > > > Or: > > > > > > Enabling this parameter may incur a noticeable performance penalty, > > > especially similar queries are executed by many concurrent connections > > > and compete to update a small number of pg_stat_statements entries. > > > > I prefer this. But what about using "identical" instead of "similar" > > because pg_stat_statements docs already uses "identical" in some places? > > I also missed "when", again... > > > > Enabling this parameter may incur a noticeable performance penalty, > > > especially when queries with identical structure are executed by many concurrent connections > > > which compete to update a small number of pg_stat_statements entries. Checking back - here's the latest patch. diff --git a/doc/src/sgml/pgstatstatements.sgml b/doc/src/sgml/pgstatstatements.sgml index 930081c429..9e98472c5c 100644 --- a/doc/src/sgml/pgstatstatements.sgml +++ b/doc/src/sgml/pgstatstatements.sgml @@ -696,8 +696,9 @@ 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 queries with the same queryid 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. The default value is off. Only superusers can change this setting.