Add statistics for INSERT/UPDATE/DELETE etc. SQL commands.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 14 Aug 2020 01:45:54 +0000 (10:45 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 14 Aug 2020 01:45:54 +0000 (10:45 +0900)
commit9f74a2281f6f10b5160051c8291713b9f5ed5205
treee5572617f06a701ab853cddfb9befad3a66c0326
parent7ccf2422cbf198ae85990f2968f4d73495f1c664
Add statistics for INSERT/UPDATE/DELETE etc. SQL commands.

We already allow to collect stats for SELECT, but it would be useful
to collect stats for other types of SQL commands. APIs to fetch stats
data is also added. No UI is added yet. Currently, any SQL commands
(besides SELECT/INSERT/UPDATE/DELETE) other than:

case(T_CheckPointStmt):
case(T_DeallocateStmt):
case(T_DiscardStmt):
case(T_ExecuteStmt):
case(T_ExplainStmt):
case(T_ListenStmt):
case(T_LoadStmt):
case(T_LockStmt):
case(T_NotifyStmt):
case(T_PrepareStmt):
case(T_TransactionStmt):
case(T_UnlistenStmt):
case(T_VacuumStmt):
case(T_VariableSetStmt):
case(T_VariableShowStmt):

are counted as DDL commands.
Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2020-July/003754.html
src/include/utils/statistics.h
src/utils/statistics.c