Re: current_query in pg_stat_activity

Поиск
Список
Период
Сортировка
От Oliver Fromme
Тема Re: current_query in pg_stat_activity
Дата
Msg-id 200402241547.i1OFlgOo093947@lurza.secnetix.de
обсуждение исходный текст
Ответ на Re: current_query in pg_stat_activity  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: current_query in pg_stat_activity  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Tom Lane wrote:
 > Oliver Fromme <olli@lurza.secnetix.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?

I'll also have to adjust the numbers in the calculations
of PGSTAT_NUM_TABENTRIES and PGSTAT_NUM_TABPURGE from
1000 to (say) 16000, of course.

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 haven't looked at 7.4.1; maybe it's already fixed.)

Best regards
   Oliver

--
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"Perl will consistently give you what you want,
unless what you want is consistency."
        -- Larry Wall

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: installing pgsql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: current_query in pg_stat_activity