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 1iiImF-0000jb-GR for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Dec 2019 13:57:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iiImD-0000B3-V3 for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Dec 2019 13:57:09 +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 1iiImD-0000Av-IR for pgsql-hackers@lists.postgresql.org; Fri, 20 Dec 2019 13:57:09 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iiImA-0006JX-Jl for pgsql-hackers@lists.postgresql.org; Fri, 20 Dec 2019 13:57:08 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1iiIm8-0007vg-19; Fri, 20 Dec 2019 08:57:04 -0500 Date: Fri, 20 Dec 2019 08:57:04 -0500 From: Bruce Momjian To: Alexey Kondratov Cc: Robert Haas , Tom Lane , v.makarov@postgrespro.ru, PostgreSQL Hackers Subject: Re: [PATCH] Increase the maximum value track_activity_query_size Message-ID: <20191220135704.GC29807@momjian.us> References: <7b5ecc5a9991045e2f13c84e3047541d@postgrespro.ru> <20191219154110.GL30116@momjian.us> <556.1576771167@sss.pgh.pa.us> <7a4ecea0-949e-efa7-865f-0ef2ddce52c3@postgrespro.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7a4ecea0-949e-efa7-865f-0ef2ddce52c3@postgrespro.ru> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Dec 20, 2019 at 02:35:37PM +0300, Alexey Kondratov wrote: > On 19.12.2019 20:52, Robert Haas wrote: > > On Thu, Dec 19, 2019 at 10:59 AM Tom Lane wrote: > > > Bruce Momjian writes: > > > > Good question. I am in favor of allowing a larger value if no one > > > > objects. I don't think adding the min/max is helpful. > > > > > > The original poster. > > > And probably anyone else, who debugs stuck queries of yet another crazy ORM. > Yes, one could use log_min_duration_statement, but having a possibility to > directly get it from pg_stat_activity without eyeballing the logs is nice. > Also, IIRC log_min_duration_statement applies only to completed statements. Yes, you would need log_statement = true. > > I think there are pretty obvious performance and memory-consumption > > penalties to very large track_activity_query_size values. Who exactly > > are we really helping if we let them set it to huge values? > > > > (wanders away wondering if we have suitable integer-overflow checks > > in relevant code paths...) > > > The value of pgstat_track_activity_query_size is in bytes, so setting it to > any value below INT_MAX seems to be safe from that perspective. However, > being multiplied by NumBackendStatSlots its reasonable value should be far > below INT_MAX (~2 GB). > > Sincerely, It does not look for me like something badly needed, but still. > We already have hundreds of GUCs and it is easy for a user to build a > sub-optimal configuration, so does this overprotection make sense? I can imagine using larger pgstat_track_activity_query_size values for data warehouse queries, where they are long and there are only a few of them. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +