Re: current_query in pg_stat_activity

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Oliver Fromme <olli(at)lurza(dot)secnetix(dot)de>, pgsql-novice(at)postgresql(dot)org
Subject: Re: current_query in pg_stat_activity
Date: 2004-02-24 15:54:29
Message-ID: 403B73B5.3020201@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Tom Lane wrote:
> Oliver Fromme <olli(at)lurza(dot)secnetix(dot)de> writes:
>> Tom Lane wrote:
>>>> Oliver Fromme <olli(at)lurza(dot)secnetix(dot)de> writes:
>>>>> The "current_query" column in the "pg_stat_activity" system
>>>>> table seems to be limited to 255 characters. Is there a way
>>>>> to increase that limit, in order to see queries completely
>>>>> which are longer than 255 characters?
>>>>
>>>> You could fool with PGSTAT_ACTIVITY_SIZE in pgstat.h, but you probably
>>>> need to keep it under 1000 --- note the comments associated with
>>>> PGSTAT_NUM_TABENTRIES.
>
>> Thanks! It appears that the size is ultimately limited
>> by the MTU of the localhost interface, which is 16K on
>> my platform (FreeBSD), so I should be able to increase
>> PGSTAT_ACTIVITY_SIZE to something like 15K, right?
>
> You'll probably find the overhead of the stats collector ballooning
> quite a lot if you increase the max message size by a factor of 15 :-(.
> But give it a try.
>
>> Oh, by the way, while I'm at it, I think I found a small
>> bug in the second of those formulas (PostgreSQL 7.3.5):
>
>> #define PGSTAT_NUM_TABPURGE ((1000 - sizeof(PgStat_MsgHdr)) \
>> / sizeof(PgStat_TableEntry))
>
>> That should be sizeof(Oid), shouldn't it? The bug doesn't
>> hurt because a Oid is much smaller than a PgStat_TableEntry,
>> but it limits the number of them inside a PgStat_MsgTabpurge
>> much more than necessary.
>
> I think you are right. Jan?

Looks very much like, as the payload of the purge message is just an
array of oids.

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Rajan Bhide 2004-02-25 08:13:36 Linking issues with libpq
Previous Message Tom Lane 2004-02-24 15:52:18 Re: current_query in pg_stat_activity