dbTalk Databases Forums  

[DOCS] track_activity_query_size note

mailing.database.pgsql-docs mailing.database.pgsql-docs


Discuss [DOCS] track_activity_query_size note in the mailing.database.pgsql-docs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thom Brown
 
Posts: n/a

Default [DOCS] track_activity_query_size note - 05-24-2012 , 07:16 AM






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


--
Sent via pgsql-docs mailing list (pgsql-docs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Reply With Quote
  #2  
Old   
Magnus Hagander
 
Posts: n/a

Default Re: [DOCS] track_activity_query_size note - 05-24-2012 , 07:39 AM






On Thu, May 24, 2012 at 2:16 PM, Thom Brown <thom (AT) linux (DOT) com> wrote:
Quote:
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/

--
Sent via pgsql-docs mailing list (pgsql-docs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Reply With Quote
  #3  
Old   
Thom Brown
 
Posts: n/a

Default Re: [DOCS] track_activity_query_size note - 05-24-2012 , 07:49 AM



On 24 May 2012 13:39, Magnus Hagander <magnus (AT) hagander (DOT) net> wrote:
Quote:
On Thu, May 24, 2012 at 2:16 PM, Thom Brown <thom (AT) linux (DOT) 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

--
Sent via pgsql-docs mailing list (pgsql-docs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Reply With Quote
  #4  
Old   
Magnus Hagander
 
Posts: n/a

Default Re: [DOCS] track_activity_query_size note - 05-24-2012 , 07:54 AM



On Thu, May 24, 2012 at 2:49 PM, Thom Brown <thom (AT) linux (DOT) com> wrote:
Quote:
On 24 May 2012 13:39, Magnus Hagander <magnus (AT) hagander (DOT) net> wrote:
On Thu, May 24, 2012 at 2:16 PM, Thom Brown <thom (AT) linux (DOT) 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/

--
Sent via pgsql-docs mailing list (pgsql-docs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Reply With Quote
  #5  
Old   
Thom Brown
 
Posts: n/a

Default Re: [DOCS] track_activity_query_size note - 05-24-2012 , 07:59 AM



On 24 May 2012 13:54, Magnus Hagander <magnus (AT) hagander (DOT) net> wrote:
Quote:
On Thu, May 24, 2012 at 2:49 PM, Thom Brown <thom (AT) linux (DOT) com> wrote:
On 24 May 2012 13:39, Magnus Hagander <magnus (AT) hagander (DOT) net> wrote:
On Thu, May 24, 2012 at 2:16 PM, Thom Brown <thom (AT) linux (DOT) 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

--
Sent via pgsql-docs mailing list (pgsql-docs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Reply With Quote
  #6  
Old   
Magnus Hagander
 
Posts: n/a

Default Re: [DOCS] track_activity_query_size note - 05-24-2012 , 08:03 AM



On Thu, May 24, 2012 at 2:59 PM, Thom Brown <thom (AT) linux (DOT) com> wrote:
Quote:
On 24 May 2012 13:54, Magnus Hagander <magnus (AT) hagander (DOT) net> wrote:
On Thu, May 24, 2012 at 2:49 PM, Thom Brown <thom (AT) linux (DOT) com> wrote:
On 24 May 2012 13:39, Magnus Hagander <magnus (AT) hagander (DOT) net> wrote:
On Thu, May 24, 2012 at 2:16 PM, Thom Brown <thom (AT) linux (DOT) 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/

--
Sent via pgsql-docs mailing list (pgsql-docs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Reply With Quote
  #7  
Old   
Tom Lane
 
Posts: n/a

Default Re: [DOCS] track_activity_query_size note - 05-24-2012 , 09:19 AM



Magnus Hagander <magnus (AT) hagander (DOT) net> writes:
Quote:
On Thu, May 24, 2012 at 2:59 PM, Thom Brown <thom (AT) linux (DOT) 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

--
Sent via pgsql-docs mailing list (pgsql-docs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Reply With Quote
  #8  
Old   
Thom Brown
 
Posts: n/a

Default Re: [DOCS] track_activity_query_size note - 05-24-2012 , 09:43 AM



On 24 May 2012 15:19, Tom Lane <tgl (AT) sss (DOT) pgh.pa.us> wrote:
Quote:
Magnus Hagander <magnus (AT) hagander (DOT) net> writes:
On Thu, May 24, 2012 at 2:59 PM, Thom Brown <thom (AT) linux (DOT) 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

--
Sent via pgsql-docs mailing list (pgsql-docs (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.