Additional global stats

Started by Magnus Haganderover 19 years ago5 messagespatches
Jump to latest
#1Magnus Hagander
magnus@hagander.net

Here's a patch to add some more data to pg_stat_database. Turns out it
was a lot easier than I thought - especially after reading Alvaros mail.
Luckily I think he was wrong this time ;-)

Does this seem like a reasonable way to do it, or did I miss something
completely?

//Magnus

Attachments:

pgstat.difftext/plain; charset=us-asciiDownload+126-12
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#1)
Re: Additional global stats

Magnus Hagander <magnus@hagander.net> writes:

Here's a patch to add some more data to pg_stat_database. Turns out it
was a lot easier than I thought - especially after reading Alvaros mail.
Luckily I think he was wrong this time ;-)

This seems like the wrong way to go about it. Why not compute these sums
on demand by scanning the stats tables, instead of bloating the stats
collector traffic even more?

regards, tom lane

#3Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#2)
Re: Additional global stats

Here's a patch to add some more data to pg_stat_database. Turns out it
was a lot easier than I thought - especially after reading Alvaros mail.
Luckily I think he was wrong this time ;-)

This seems like the wrong way to go about it. Why not compute these sums
on demand by scanning the stats tables, instead of bloating the stats
collector traffic even more?

Stats traffic should not be affected at all. It just user the same messages already there to increase a couple of global counters per database. The only thing
that increases is that the stats file gets another 5 counters per database. Given how few databases you normally have compared to number of tables, I would
think that should be pretty trivial.

Scanning them on demand will require loading the whole stats file into the backend instead of just the current database, which I considered more bloated..

/Magnus

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#3)
Re: Additional global stats

"Magnus Hagander" <magnus@hagander.net> writes:

Scanning them on demand will require loading the whole stats file into
the backend instead of just the current database,

Good point --- objection withdrawn.

regards, tom lane

#5Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#4)
Re: Additional global stats

Tom Lane wrote:

"Magnus Hagander" <magnus@hagander.net> writes:

Scanning them on demand will require loading the whole stats file into
the backend instead of just the current database,

Good point --- objection withdrawn.

Thanks. I also realized I had not documented the functions, and only the
view. And of course also needed to update the expected files for the
rules regression test. All done ;-)

//Magnus