Re: [PATCH] Increase the maximum value track_activity_query_size

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Treat <rob(at)xzilla(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Bruce Momjian <bruce(at)momjian(dot)us>, Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>, v(dot)makarov(at)postgrespro(dot)ru, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Increase the maximum value track_activity_query_size
Date: 2019-12-31 00:46:42
Message-ID: 20191231004642.3rl5ndcj27wq6t3w@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 31, 2019 at 10:25:26AM +1030, Andrew Dunstan wrote:
>On Tue, Dec 31, 2019 at 10:16 AM Andrew Dunstan
><andrew(dot)dunstan(at)2ndquadrant(dot)com> wrote:
>>
>> On Tue, Dec 31, 2019 at 9:38 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>
>> >
>> > This doesn't seem like a reason not to allow a higher limit, like a
>> > megabyte or so, but I'm not sure that pushing it to the moon would be
>> > wise.
>> >
>>
>>
>> Just to get a mental handle on the size of queries we might be
>> allowing before truncation, I did some very rough arithmetic on what
>> well known texts might fit in a megabyte. By my calculations you could
>> fit about four Animal Farms or one Madame Bovary in about a megabyte.
>> So I think that seems like more than enough :-). (My mind kinda
>> explores at the thought of debugging a query as long as Animal Farm.)
>>
>
>
>Turns out my arithmetic was a bit off. Animal Farm is 90 kb, Madame
>Bovary 678 Kb.
>

Not sure, but the Animal Farm text I found is about ~450kB (~120 pages,
with ~3kB per page) ...

Anyway, the longest queries I personally saw in production were a couple
of kB long (~32kB IIRC, it's been a couple years ago). The queries were
generated by the application (not quite a traditional ORM, but something
like it), with long identifiers (e.g. table names) pretty long due to
including a hash (so being 63 characters most of the time). Plus the
columns were always fully qualified, with multiple joins etc.

Not sure what a good limit would be. Obviously, if we pick value X, the
next day someone will come asking for X+1 ... ;-)

regards

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jon Jensen 2019-12-31 01:11:36 [PATCH] Fix parallel query doc typos
Previous Message Alvaro Herrera 2019-12-31 00:10:53 Re: [PATCH] Increase the maximum value track_activity_query_size