pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
track_activity_query_size note
8+ messages / 3 participants
[nested] [flat]

* track_activity_query_size note
@ 2012-05-24 12:16  Thom Brown <thom@linux.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Thom Brown @ 2012-05-24 12:16 UTC (permalink / raw)
  To: pgsql-docs

Hi,

I attach a proposed change to the docs which points out that if the
size of track_activity_query_size is changed and the is server
restarted, it won't have any effect if query statistics are already
present.

Thanks

Thom

Attachments:

track_activity_query_size_note.patch (application/octet-stream, 615B) download diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 074afee..e02b94d 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -4290,7 +4290,8 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv; executing command for each active session, for the <structname>pg_stat_activity</>.<structfield>query</> field. The default value is 1024. This parameter can only be set at server - start. + start and will also not take effect until any pre-existing statistics + are cleared. </para> </listitem> </varlistentry>
^ permalink raw reply [nested|flat] 8+ messages in thread

* Re: track_activity_query_size note
@ 2012-05-24 12:39  Magnus Hagander <magnus@hagander.net>
  parent: Thom Brown <thom@linux.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Magnus Hagander @ 2012-05-24 12:39 UTC (permalink / raw)
  To: Thom Brown <thom@linux.com>; +Cc: pgsql-docs

On Thu, May 24, 2012 at 2:16 PM, Thom Brown <thom@linux.com> wrote:
> Hi,
>
> I attach a proposed change to the docs which points out that if the
> size of track_activity_query_size is changed and the is server
> restarted, it won't have any effect if query statistics are already
> present.

But aren't pg_stat_activity queries always cleared when you restart
the server - because they are all disconnected... And you can't change
track_activity_query_size without restarting.

-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: track_activity_query_size note
@ 2012-05-24 12:49  Thom Brown <thom@linux.com>
  parent: Magnus Hagander <magnus@hagander.net>
  0 siblings, 1 reply; 8+ messages in thread

From: Thom Brown @ 2012-05-24 12:49 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: pgsql-docs

On 24 May 2012 13:39, Magnus Hagander <magnus@hagander.net> wrote:
> On Thu, May 24, 2012 at 2:16 PM, Thom Brown <thom@linux.com> wrote:
>> Hi,
>>
>> I attach a proposed change to the docs which points out that if the
>> size of track_activity_query_size is changed and the is server
>> restarted, it won't have any effect if query statistics are already
>> present.
>
> But aren't pg_stat_activity queries always cleared when you restart
> the server - because they are all disconnected... And you can't change
> track_activity_query_size without restarting.

But not pg_stat_statistics queries, which is where I should have
probably made the note.  Restarting the server won't change the length
of the field if there's already data present in pg_stat_statistics,
but upon resetting them, the field is appropriately sized.

-- 
Thom



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: track_activity_query_size note
@ 2012-05-24 12:54  Magnus Hagander <magnus@hagander.net>
  parent: Thom Brown <thom@linux.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Magnus Hagander @ 2012-05-24 12:54 UTC (permalink / raw)
  To: Thom Brown <thom@linux.com>; +Cc: pgsql-docs

On Thu, May 24, 2012 at 2:49 PM, Thom Brown <thom@linux.com> wrote:
> On 24 May 2012 13:39, Magnus Hagander <magnus@hagander.net> wrote:
>> On Thu, May 24, 2012 at 2:16 PM, Thom Brown <thom@linux.com> wrote:
>>> Hi,
>>>
>>> I attach a proposed change to the docs which points out that if the
>>> size of track_activity_query_size is changed and the is server
>>> restarted, it won't have any effect if query statistics are already
>>> present.
>>
>> But aren't pg_stat_activity queries always cleared when you restart
>> the server - because they are all disconnected... And you can't change
>> track_activity_query_size without restarting.
>
> But not pg_stat_statistics queries, which is where I should have
> probably made the note.  Restarting the server won't change the length
> of the field if there's already data present in pg_stat_statistics,
> but upon resetting them, the field is appropriately sized.

Uh, what's pg_stat_statistics?

-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: track_activity_query_size note
@ 2012-05-24 12:59  Thom Brown <thom@linux.com>
  parent: Magnus Hagander <magnus@hagander.net>
  0 siblings, 1 reply; 8+ messages in thread

From: Thom Brown @ 2012-05-24 12:59 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: pgsql-docs

On 24 May 2012 13:54, Magnus Hagander <magnus@hagander.net> wrote:
> On Thu, May 24, 2012 at 2:49 PM, Thom Brown <thom@linux.com> wrote:
>> On 24 May 2012 13:39, Magnus Hagander <magnus@hagander.net> wrote:
>>> On Thu, May 24, 2012 at 2:16 PM, Thom Brown <thom@linux.com> wrote:
>>>> Hi,
>>>>
>>>> I attach a proposed change to the docs which points out that if the
>>>> size of track_activity_query_size is changed and the is server
>>>> restarted, it won't have any effect if query statistics are already
>>>> present.
>>>
>>> But aren't pg_stat_activity queries always cleared when you restart
>>> the server - because they are all disconnected... And you can't change
>>> track_activity_query_size without restarting.
>>
>> But not pg_stat_statistics queries, which is where I should have
>> probably made the note.  Restarting the server won't change the length
>> of the field if there's already data present in pg_stat_statistics,
>> but upon resetting them, the field is appropriately sized.
>
> Uh, what's pg_stat_statistics?

s/pg_stat_statistics/pg_stat_statements/

-- 
Thom



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: track_activity_query_size note
@ 2012-05-24 13:03  Magnus Hagander <magnus@hagander.net>
  parent: Thom Brown <thom@linux.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Magnus Hagander @ 2012-05-24 13:03 UTC (permalink / raw)
  To: Thom Brown <thom@linux.com>; +Cc: pgsql-docs

On Thu, May 24, 2012 at 2:59 PM, Thom Brown <thom@linux.com> wrote:
> On 24 May 2012 13:54, Magnus Hagander <magnus@hagander.net> wrote:
>> On Thu, May 24, 2012 at 2:49 PM, Thom Brown <thom@linux.com> wrote:
>>> On 24 May 2012 13:39, Magnus Hagander <magnus@hagander.net> wrote:
>>>> On Thu, May 24, 2012 at 2:16 PM, Thom Brown <thom@linux.com> wrote:
>>>>> Hi,
>>>>>
>>>>> I attach a proposed change to the docs which points out that if the
>>>>> size of track_activity_query_size is changed and the is server
>>>>> restarted, it won't have any effect if query statistics are already
>>>>> present.
>>>>
>>>> But aren't pg_stat_activity queries always cleared when you restart
>>>> the server - because they are all disconnected... And you can't change
>>>> track_activity_query_size without restarting.
>>>
>>> But not pg_stat_statistics queries, which is where I should have
>>> probably made the note.  Restarting the server won't change the length
>>> of the field if there's already data present in pg_stat_statistics,
>>> but upon resetting them, the field is appropriately sized.
>>
>> Uh, what's pg_stat_statistics?
>
> s/pg_stat_statistics/pg_stat_statements/

Ah, suddenly it makes sense.

And in that case yes, the docs changes should go under
pg_stat_statements, I believe.

-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: track_activity_query_size note
@ 2012-05-24 14:19  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Magnus Hagander <magnus@hagander.net>
  0 siblings, 1 reply; 8+ messages in thread

From: Tom Lane @ 2012-05-24 14:19 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: Thom Brown <thom@linux.com>; pgsql-docs

Magnus Hagander <magnus@hagander.net> writes:
> On Thu, May 24, 2012 at 2:59 PM, Thom Brown <thom@linux.com> wrote:
>>> I attach a proposed change to the docs which points out that if the
>>> size of track_activity_query_size is changed and the is server
>>> restarted, it won't have any effect if query statistics are already
>>> present.

> Ah, suddenly it makes sense.

> And in that case yes, the docs changes should go under
> pg_stat_statements, I believe.

But surely the statement is flat out wrong; or if it's not wrong,
there's a bug somewhere.  We do not absorb the value of
track_activity_query_size from the stats file.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: track_activity_query_size note
@ 2012-05-24 14:43  Thom Brown <thom@linux.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 8+ messages in thread

From: Thom Brown @ 2012-05-24 14:43 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Magnus Hagander <magnus@hagander.net>; pgsql-docs

On 24 May 2012 15:19, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Magnus Hagander <magnus@hagander.net> writes:
>> On Thu, May 24, 2012 at 2:59 PM, Thom Brown <thom@linux.com> wrote:
>>>> I attach a proposed change to the docs which points out that if the
>>>> size of track_activity_query_size is changed and the is server
>>>> restarted, it won't have any effect if query statistics are already
>>>> present.
>
>> Ah, suddenly it makes sense.
>
>> And in that case yes, the docs changes should go under
>> pg_stat_statements, I believe.
>
> But surely the statement is flat out wrong; or if it's not wrong,
> there's a bug somewhere.  We do not absorb the value of
> track_activity_query_size from the stats file.

Hmm... well I think I may have misinterpreted the behaviour.  What I
saw was the size of the query shown in pg_stat_statements remaining
unchanged after restarting the server with a new
track_activity_query_size value, but I'm guessing this is merely
because its representation remains unchanged.  If I run the same query
with an extra condition on the end, it shows up as a separate row, but
not truncated to the same length as the previous query.

So I retract my proposed amendment as it's a falsehood.  It was merely
an unexpected behaviour on my part.  The truth is that pre-existing
queries listed in pg_stat_statements won't magically become less
truncated if track_activity_query_size is increased.  That only
applies to new entries from that point that don't share the same query
signature.

-- 
Thom



^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2012-05-24 14:43 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-05-24 12:16 track_activity_query_size note Thom Brown <thom@linux.com>
2012-05-24 12:39 ` Magnus Hagander <magnus@hagander.net>
2012-05-24 12:49   ` Thom Brown <thom@linux.com>
2012-05-24 12:54     ` Magnus Hagander <magnus@hagander.net>
2012-05-24 12:59       ` Thom Brown <thom@linux.com>
2012-05-24 13:03         ` Magnus Hagander <magnus@hagander.net>
2012-05-24 14:19           ` Tom Lane <tgl@sss.pgh.pa.us>
2012-05-24 14:43             ` Thom Brown <thom@linux.com>

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