Thread: pgsql: Add a generic command progress reporting facility.

pgsql: Add a generic command progress reporting facility.

From
Robert Haas
Date:
Add a generic command progress reporting facility.

Using this facility, any utility command can report the target relation
upon which it is operating, if there is one, and up to 10 64-bit
counters; the intent of this is that users should be able to figure out
what a utility command is doing without having to resort to ugly hacks
like attaching strace to a backend.

As a demonstration, this adds very crude reporting to lazy vacuum; we
just report the target relation and nothing else.  A forthcoming patch
will make VACUUM report a bunch of additional data that will make this
much more interesting.  But this gets the basic framework in place.

Vinayak Pokale, Rahila Syed, Amit Langote, Robert Haas, reviewed by
Kyotaro Horiguchi, Jim Nasby, Thom Brown, Masahiko Sawada, Fujii Masao,
and Masanori Oyama.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/b6fb6471f6afaf649e52f38269fd8c5c60647669

Modified Files
--------------
src/backend/access/transam/xact.c   |   4 ++
src/backend/commands/vacuumlazy.c   |   4 ++
src/backend/postmaster/pgstat.c     |  73 +++++++++++++++++++++++++
src/backend/utils/adt/pgstatfuncs.c | 103 ++++++++++++++++++++++++++++++++++++
src/include/catalog/catversion.h    |   2 +-
src/include/catalog/pg_proc.h       |   2 +
src/include/pgstat.h                |  30 +++++++++++
7 files changed, 217 insertions(+), 1 deletion(-)