Re: [PERFORM] pg_stat_statements query normalization

2013-06-19 Thread Sameer Thakur
>Why don't you play around with it and see for yourself?
I did that. Populated a sample table and then queried on it multiple times
for each condition (=,>,<) with different constant values. Then queried
pg_stat_statements view. Saw three different records corresponding to each
condition query text (=?,>?,

[PERFORM] pg_stat_statements behavior in crash recovery

2013-06-19 Thread Sameer Thakur
Hello,
I understand that when the pg_stat_statements.save=true the
statement statistics are saved at global/pg_stat_statements.stat. This file
is read on next startup and then deleted.
If there is a crash i understand that pg_stat_statements.stat file is not
created even if  pg_stat_statements.save=true.
 If the crash happened before pg_stat_statements.stat file  is deleted
then, on recovery, is that pg_stat_statements.stat file deleted?
On crash recovery, are statement statistics reset ,to same values as would
be the case on normal startup in the case pg_stat_statements.save=false?
Thank you
Sameer


Re: [PERFORM] pg_stat_statements behavior in crash recovery

2013-06-19 Thread Peter Geoghegan
On Wed, Jun 19, 2013 at 5:32 AM, Sameer Thakur  wrote:
> If there is a crash i understand that pg_stat_statements.stat file is not
> created even if  pg_stat_statements.save=true.
>  If the crash happened before pg_stat_statements.stat file  is deleted then,
> on recovery, is that pg_stat_statements.stat file deleted?
> On crash recovery, are statement statistics reset ,to same values as would
> be the case on normal startup in the case pg_stat_statements.save=false?

The pg_stat_statements statistics file is just deleted when the server
starts, and statistics are serialized to disk when there's a clean
shutdown. pg_stat_statements is similar to the statistics collector
here.

Why are you posting this to the -performance list?

-- 
Regards,
Peter Geoghegan


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


Re: [PERFORM] pg_stat_statements behavior in crash recovery

2013-06-19 Thread Sameer Thakur
>Why are you posting this to the -performance list?
Sorry, maybe -general was the correct place. I thought that
pg_stat_statements was a performance diagnostics tool, so -performance was
the correct forum
Thank you
Sameer