Skip site navigation (1) Skip section navigation (2)

Re: keeping a timestamp of the last stats reset (for a db, table and function)

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: keeping a timestamp of the last stats reset (for a db, table and function)
Date: 2011-02-06 07:17:27
Message-ID: 4D4E4B07.8060102@2ndquadrant.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Tomas Vondra wrote:
> Because when I create a database, the field is
> NULL - that's true. But once I connect to the database, the stats are
> updated and the field is set (thanks to the logic in pgstat.c).
>   

OK--so it does what I was hoping for, I just didn't test it the right 
way.  Let's call that a documentation issue and move on.

Attached is an updated patch that fixes the docs and some other random 
bits.  Looks ready for committer to me now.  Make sure to adjust 
PGSTAT_FILE_FORMAT_ID, do a cat version bump, and set final OIDs for the 
new functions.

Below is what changed since the last posted version, mainly as feedback 
for Tomas:

-Explained more clearly that pg_stat_reset and 
pg_stat_reset_single_counters will both touch the database reset time, 
and that it's initialized upon first connection to the database.

-Added the reset time to the list of fields in pg_stat_database and 
pg_stat_bgwriter.

-Fixed some tab/whitespace issues.  It looks like you had tab stops set 
at 8 characters during some points when you were editing non-code 
files.  Also, there were a couple of spot where you used a tab while 
text in the area used spaces.  You can normally see both types of errors 
if you read a patch, they showed up as misaligned things in the context 
diff.

-Removed some extra blank lines that didn't fit the style of the 
surrounding code.

Basically, all the formatting bits I'm nitpicking about I found just by 
reading the patch itself; they all stuck right out.  I'd recommend a 
pass of that before submitting things if you want to try and avoid those 
in the future.

-- 
Greg Smith   2ndQuadrant US    greg(at)2ndQuadrant(dot)com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books


Attachment: stat-time-reset-4.diff
Description: text/x-patch (12.3 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Alex HunsakerDate: 2011-02-06 07:43:51
Subject: Re: arrays as pl/perl input arguments [PATCH]
Previous:From: Robert HaasDate: 2011-02-06 07:15:47
Subject: Re: ALTER TYPE 2: skip already-provable no-work rewrites

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group