pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Alexey Kondratov <a.kondratov@postgrespro.ru>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: v.makarov@postgrespro.ru
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: [PATCH] Increase the maximum value track_activity_query_size
Date: Fri, 20 Dec 2019 08:57:04 -0500
Message-ID: <20191220135704.GC29807@momjian.us> (raw)
In-Reply-To: <7a4ecea0-949e-efa7-865f-0ef2ddce52c3@postgrespro.ru>
References: <7b5ecc5a9991045e2f13c84e3047541d@postgrespro.ru>
	<20191219154110.GL30116@momjian.us>
	<556.1576771167@sss.pgh.pa.us>
	<CA+Tgmobjp+cqjNW+397Ejbo=M8XNzykQPspfhbd39DVc8Wd7Wg@mail.gmail.com>
	<7a4ecea0-949e-efa7-865f-0ef2ddce52c3@postgrespro.ru>

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 <tgl@sss.pgh.pa.us> wrote:
> > > Bruce Momjian <bruce@momjian.us> 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  <bruce@momjian.us>        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 +





view thread (29+ messages)  latest in thread

Message-ID: <20191220135704.GC29807@momjian.us>
Permalink:  ../20191220135704.GC29807@momjian.us/
Also on:    postgresql.org/message-id/20191220135704.GC29807@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: bruce@momjian.us, a.kondratov@postgrespro.ru, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, v.makarov@postgrespro.ru
  Subject: Re: [PATCH] Increase the maximum value track_activity_query_size
  In-Reply-To: <20191220135704.GC29807@momjian.us>
  References: <7b5ecc5a9991045e2f13c84e3047541d@postgrespro.ru> <20191219154110.GL30116@momjian.us> <556.1576771167@sss.pgh.pa.us> <CA+Tgmobjp+cqjNW+397Ejbo=M8XNzykQPspfhbd39DVc8Wd7Wg@mail.gmail.com> <7a4ecea0-949e-efa7-865f-0ef2ddce52c3@postgrespro.ru> <20191220135704.GC29807@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox