pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Robert Treat <rob@xzilla.net>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Nikolay Samokhvalov <samokhvalov@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Alexey Kondratov <a.kondratov@postgrespro.ru>
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: Mon, 30 Dec 2019 22:33:42 +0100
Message-ID: <20191230213342.jmtvp2kmqdtt55sp@development> (raw)
In-Reply-To: <CABV9wwOXrWH2qdPvjzjUTMB1WKF=3NuUguLXnwEkQmZHt5AyiA@mail.gmail.com>
References: <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>
	<20191221024757.GF15758@paquier.xyz>
	<CANNMO+LrCCMTJBgETVyWdRGmwkT8hO9utF1RtdpsO=w765z6PQ@mail.gmail.com>
	<25274.1576963505@sss.pgh.pa.us>
	<CA+TgmoZSs4BZ+CQ6x0Vswxhc8A6r78iCNLcJKWLazGWCqKHnYw@mail.gmail.com>
	<CABV9wwOXrWH2qdPvjzjUTMB1WKF=3NuUguLXnwEkQmZHt5AyiA@mail.gmail.com>

On Mon, Dec 30, 2019 at 12:46:40PM -0800, Robert Treat wrote:
>On Mon, Dec 23, 2019 at 9:11 PM Robert Haas <robertmhaas@gmail.com> wrote:
>>
>> On Sat, Dec 21, 2019 at 1:25 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> > > What is the overhead here except the memory consumption?
>> >
>> > The time to copy those strings out of shared storage, any time
>> > you query pg_stat_activity.
>>
>> It seems like you're masterminding this, and I don't know why. It
>> seems unlikely that anyone will raise the value unless they have very
>> long queries, and if those people would rather pay the overhead of
>> copying more data than have their queries truncated, who are we to
>> argue?
>>
>> If increasing the maximum imposed some noticeable cost on
>> installations the kept the default setting, that might well be a good
>> argument for not raising the maximum. But I don't think that's the
>> case. I also suspect that the overhead would be pretty darn small even
>> for people who *do* raise the default setting. It looks to me like
>> both reading and write operations on st_activity_raw stop when they
>> hit a NUL byte, so any performance costs on short queries must come
>> from second-order effects (e.g. the main shared memory segment is
>> bigger, so the OS cache is smaller) which are likely irrelevant in
>> practice.
>>
>
>I'm generally in favor of the idea of allowing people to make
>trade-offs that best work for them, but Tom's concern does give me
>pause, because it isn't clear to me how people will measure the
>overhead of upping this setting. If given the option people will
>almost certainly start raising this limit because the benefits are
>obvious ("I can see all my query now!") but so far the explanation of
>the downsides have been either hand-wavy or, in the case of your
>second paragraph, an argument they are non-existent, which doesn't
>seem right either; so how do we explain to people how to measure the
>overhead for them?
>

I think there are two questions that we need to answer:

1) Does allowing higher values for the GUC mean overhead for people who
don't actually increase it?

I don't think so.

2) What's the overhead for increasing the value for short/long queries?

My assumption is that for short queries, it's going to be negligible.
For longer queries it may be measurable, but I'd expect longer queries
to be more expensive in general, so maybe it's still negligible.

Of course, the easiest thing we can do is actually measuring this.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (29+ messages)  latest in thread

Message-ID: <20191230213342.jmtvp2kmqdtt55sp@development>
Permalink:  ../20191230213342.jmtvp2kmqdtt55sp@development/
Also on:    postgresql.org/message-id/20191230213342.jmtvp2kmqdtt55sp@development

 · 

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: tomas.vondra@2ndquadrant.com, rob@xzilla.net, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, samokhvalov@gmail.com, michael@paquier.xyz, bruce@momjian.us, a.kondratov@postgrespro.ru, v.makarov@postgrespro.ru
  Subject: Re: [PATCH] Increase the maximum value track_activity_query_size
  In-Reply-To: <20191230213342.jmtvp2kmqdtt55sp@development>
  References: <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> <20191221024757.GF15758@paquier.xyz> <CANNMO+LrCCMTJBgETVyWdRGmwkT8hO9utF1RtdpsO=w765z6PQ@mail.gmail.com> <25274.1576963505@sss.pgh.pa.us> <CA+TgmoZSs4BZ+CQ6x0Vswxhc8A6r78iCNLcJKWLazGWCqKHnYw@mail.gmail.com> <CABV9wwOXrWH2qdPvjzjUTMB1WKF=3NuUguLXnwEkQmZHt5AyiA@mail.gmail.com> <20191230213342.jmtvp2kmqdtt55sp@development>

* 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