[pgpool-hackers: 3754] More SQL stats?

Tatsuo Ishii ishii at sraoss.co.jp
Fri Jul 31 10:28:01 JST 2020


Currently we only collect SELECT counts for each backend node and show
them in "show pool_nodes". I think it would be nice if we could
collect other counts, for example INSERT/UPDATE/DELETE and show
them. I know that PostgreSQL already has such a feature but still I
think having that statistics in Pgpool-II would be convenient for
admins because he/she can grab statistics on all node at once, rather
than querying against each backend node one by one.

Moreover we already have such that statistics are on shared memory:

/*
 * Per backend node stat area in shared memory
 */
typedef struct
{
	uint64		select_cnt;		/* number of read SELECT queries issued */
	uint64		insert_cnt;		/* number of INSERT queries issued */
	uint64		update_cnt;		/* number of UPDATE queries issued */
	uint64		delete_cnt;		/* number of DELETE queries issued */
	uint64		ddl_cnt;		/* number of DDL queries issued */
	uint64		other_cnt;		/* number of any other queries issued */
}			PER_NODE_STAT;
[src/utils/statistics.c]

Actually we haven't used them except select_cnt. The only thing we
have to do is, update the stats above when SQL is executed.

It is debatable we'd better to add another show command for this
purpose however. (show pool_nodes has already many columns).

Opinions?
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-hackers mailing list