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 1lYVJb-0003H7-Tr for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Apr 2021 14:55:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lYVJa-0004xp-RN for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Apr 2021 14:55:54 +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 1lYVJa-0004xd-HG for pgsql-hackers@lists.postgresql.org; Mon, 19 Apr 2021 14:55:54 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lYVJV-0005u3-V8 for pgsql-hackers@postgresql.org; Mon, 19 Apr 2021 14:55:53 +0000 Received: by mail-oi1-x230.google.com with SMTP id u16so18368363oiu.7 for ; Mon, 19 Apr 2021 07:55:49 -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:content-transfer-encoding:in-reply-to :user-agent; bh=cjnO81/ZrEWeGmjdlhgP/yzKvrPqZcFh7WnMaHhN3cs=; b=2KFJun2nXLY+FBp5H9HoLTyQ/uy9Z2nojanC6gmu7+GLdgczr4f4wSoLy45MVvgfYg 2k9RxokM51pCM7C2UiBnVO7XJtLUaType1GkFzBj+Yh7hfYbNmaKECuIPOfCG1Jpos7+ iqRUB/L/OFx50RiYUkaWOihq071jDQ1UOrJPP7DT6BGlL4MgWyJq/BZxQCJixqiE3Mld Kz8UNCqglZ/JZmtMgmg6+Cw8yiTEnGPa6xEAqzcSJzU+P2oXCpJwI3V6FsVe4hPob/jM VTgq+jrAPL/z9WlNEQ3oJLeIo2LpKCsSjYUA7MlLB/XSHr94dN5XILLc7S7knuk9hNlo FXrg== 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:content-transfer-encoding :in-reply-to:user-agent; bh=cjnO81/ZrEWeGmjdlhgP/yzKvrPqZcFh7WnMaHhN3cs=; b=kWKLyEajFr0TerlkNz6pnOKhrQesqM1dIqONfDmoH6WH38KJV1tn5SsJMLXYifvYR+ Uev7yAb1eFKPQC7W2kdvLWSV/NVlzxYgVICne7GBZjbIYmmgrbVDRXtKRYVF3cSmeViG JuhlTqhGjbObtOn6soexuKg1swzv0vtLx8aipWKS/UVF8wGDOsrQV/KL4H5Vlllg24Ks idkPpFMXJkd/P3h/iaB2hCCjZkfDn61TJ82l4Ur76bYQO6CJoLn7E526JOLFRnJ5qVkI ylHabcCYjXpLt/9wRLFXwnoGC+p6eN+cBLjK4zIzIwGFO2EtMWwEb4NA9h3yvlSgf0hE wX+A== X-Gm-Message-State: AOAM533U9NqYUmZgmBg10HVz3QCMcMULVUKisqrjuTeZ4jjPaodB1KW6 aAPbgoL+z1YaTMIFkQbTNqjy5w== X-Google-Smtp-Source: ABdhPJycu/9l1FgSQEcBh+p1eIE9WqGAuAHaW0rR8PCSEEE2Gcb8jhn1A7IVZ9WLE+BCn0sgmdC96A== X-Received: by 2002:aca:44d6:: with SMTP id r205mr16093417oia.172.1618844147705; Mon, 19 Apr 2021 07:55:47 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id o6sm1140640ote.14.2021.04.19.07.55.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Apr 2021 07:55:47 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id CBC65800A22; Mon, 19 Apr 2021 09:55:45 -0500 (CDT) Date: Mon, 19 Apr 2021 09:55:45 -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: <20210419145545.GF7256@telsasoft.com> References: <42a13b4c-e60c-c6e7-3475-8eff8050bed4@oss.nttdata.com> <646e5cae-5e8b-feaa-43dc-014bf355bf08@oss.nttdata.com> <20210418233615.GB7256@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Mon, Apr 19, 2021 at 11:44:05PM +0900, Fujii Masao wrote: > On 2021/04/19 8:36, Justin Pryzby wrote: > > Reviewing this change which was committed last year as > > 321fa6a4a26c9b649a0fbec9fc8b019f19e62289 > > > > On Fri, Jul 03, 2020 at 03:57:38PM +0900, Fujii Masao wrote: > > > On 2020/07/03 13:05, Pavel Stehule wrote: > > > > pá 3. 7. 2020 v 4:39 odesílatel Fujii Masao napsal: > > > > > > > > Maybe there can be documented so enabling this option can have a negative impact on performance. > > > > > > Yes. What about adding either of the followings into the doc? > > > > > > Enabling this parameter may incur a noticeable performance penalty. > > > > > > or > > > > > > Enabling this parameter may incur a noticeable performance penalty, > > > especially when a fewer kinds of queries are executed on many > > > concurrent connections. > > > > Something seems is wrong with this sentence, and I'm not sure what it's trying > > to say. Is this right ? > > pg_stat_statements users different spinlock for each kind of query. > So fewer kinds of queries many sessions execute, fewer spinlocks > they try to acquire. This may lead to spinlock contention and > significant performance degration. This is what the statement is > trying to say. What does "kind" mean ? I think it means a "normalized" query or a "query structure". "a fewer kinds" is wrong, so I think the docs should say "a small number of queries" or maybe: > > > Enabling this parameter may incur a noticeable performance penalty, > > > especially similar queries are run by many concurrent connections and > > > compete to update the same pg_stat_statements entry -- Justin