PostgreSQL Source Code  git master
pgstat.h
Go to the documentation of this file.
1 /* ----------
2  * pgstat.h
3  *
4  * Definitions for the PostgreSQL statistics collector daemon.
5  *
6  * Copyright (c) 2001-2021, PostgreSQL Global Development Group
7  *
8  * src/include/pgstat.h
9  * ----------
10  */
11 #ifndef PGSTAT_H
12 #define PGSTAT_H
13 
14 #include "datatype/timestamp.h"
15 #include "portability/instr_time.h"
16 #include "postmaster/pgarch.h" /* for MAX_XFN_CHARS */
17 #include "utils/backend_progress.h" /* for backward compatibility */
18 #include "utils/backend_status.h" /* for backward compatibility */
19 #include "utils/hsearch.h"
20 #include "utils/relcache.h"
21 #include "utils/wait_event.h" /* for backward compatibility */
22 
23 
24 /* ----------
25  * Paths for the statistics files (relative to installation's $PGDATA).
26  * ----------
27  */
28 #define PGSTAT_STAT_PERMANENT_DIRECTORY "pg_stat"
29 #define PGSTAT_STAT_PERMANENT_FILENAME "pg_stat/global.stat"
30 #define PGSTAT_STAT_PERMANENT_TMPFILE "pg_stat/global.tmp"
31 
32 /* Default directory to store temporary statistics data in */
33 #define PG_STAT_TMP_DIR "pg_stat_tmp"
34 
35 /* Values for track_functions GUC variable --- order is significant! */
36 typedef enum TrackFunctionsLevel
37 {
42 
43 /* Values to track the cause of session termination */
44 typedef enum SessionEndType
45 {
46  DISCONNECT_NOT_YET, /* still active */
52 
53 /* ----------
54  * The types of backend -> collector messages
55  * ----------
56  */
57 typedef enum StatMsgType
58 {
86 } StatMsgType;
87 
88 /* ----------
89  * The data type used for counters.
90  * ----------
91  */
92 typedef int64 PgStat_Counter;
93 
94 /* ----------
95  * PgStat_TableCounts The actual per-table counts kept by a backend
96  *
97  * This struct should contain only actual event counters, because we memcmp
98  * it against zeroes to detect whether there are any counts to transmit.
99  * It is a component of PgStat_TableStatus (within-backend state) and
100  * PgStat_TableEntry (the transmitted message format).
101  *
102  * Note: for a table, tuples_returned is the number of tuples successfully
103  * fetched by heap_getnext, while tuples_fetched is the number of tuples
104  * successfully fetched by heap_fetch under the control of bitmap indexscans.
105  * For an index, tuples_returned is the number of index entries returned by
106  * the index AM, while tuples_fetched is the number of tuples successfully
107  * fetched by heap_fetch under the control of simple indexscans for this index.
108  *
109  * tuples_inserted/updated/deleted/hot_updated count attempted actions,
110  * regardless of whether the transaction committed. delta_live_tuples,
111  * delta_dead_tuples, and changed_tuples are set depending on commit or abort.
112  * Note that delta_live_tuples and delta_dead_tuples can be negative!
113  * ----------
114  */
115 typedef struct PgStat_TableCounts
116 {
118 
121 
127 
131 
135 
136 /* Possible targets for resetting cluster-wide shared values */
138 {
143 
144 /* Possible object types for resetting single counters */
146 {
150 
151 /* ------------------------------------------------------------
152  * Structures kept in backend local memory while accumulating counts
153  * ------------------------------------------------------------
154  */
155 
156 
157 /* ----------
158  * PgStat_TableStatus Per-table status within a backend
159  *
160  * Many of the event counters are nontransactional, ie, we count events
161  * in committed and aborted transactions alike. For these, we just count
162  * directly in the PgStat_TableStatus. However, delta_live_tuples,
163  * delta_dead_tuples, and changed_tuples must be derived from event counts
164  * with awareness of whether the transaction or subtransaction committed or
165  * aborted. Hence, we also keep a stack of per-(sub)transaction status
166  * records for every table modified in the current transaction. At commit
167  * or abort, we propagate tuples_inserted/updated/deleted up to the
168  * parent subtransaction level, or out to the parent PgStat_TableStatus,
169  * as appropriate.
170  * ----------
171  */
172 typedef struct PgStat_TableStatus
173 {
174  Oid t_id; /* table's OID */
175  bool t_shared; /* is it a shared catalog? */
176  struct PgStat_TableXactStatus *trans; /* lowest subxact's counts */
177  PgStat_TableCounts t_counts; /* event counts to be sent */
179 
180 /* ----------
181  * PgStat_TableXactStatus Per-table, per-subtransaction status
182  * ----------
183  */
185 {
186  PgStat_Counter tuples_inserted; /* tuples inserted in (sub)xact */
187  PgStat_Counter tuples_updated; /* tuples updated in (sub)xact */
188  PgStat_Counter tuples_deleted; /* tuples deleted in (sub)xact */
189  bool truncated; /* relation truncated in this (sub)xact */
190  PgStat_Counter inserted_pre_trunc; /* tuples inserted prior to truncate */
191  PgStat_Counter updated_pre_trunc; /* tuples updated prior to truncate */
192  PgStat_Counter deleted_pre_trunc; /* tuples deleted prior to truncate */
193  int nest_level; /* subtransaction nest level */
194  /* links to other structs for same relation: */
195  struct PgStat_TableXactStatus *upper; /* next higher subxact if any */
196  PgStat_TableStatus *parent; /* per-table status */
197  /* structs of same subxact level are linked here: */
198  struct PgStat_TableXactStatus *next; /* next of same subxact */
200 
201 
202 /* ------------------------------------------------------------
203  * Message formats follow
204  * ------------------------------------------------------------
205  */
206 
207 
208 /* ----------
209  * PgStat_MsgHdr The common message header
210  * ----------
211  */
212 typedef struct PgStat_MsgHdr
213 {
215  int m_size;
216 } PgStat_MsgHdr;
217 
218 /* ----------
219  * Space available in a message. This will keep the UDP packets below 1K,
220  * which should fit unfragmented into the MTU of the loopback interface.
221  * (Larger values of PGSTAT_MAX_MSG_SIZE would work for that on most
222  * platforms, but we're being conservative here.)
223  * ----------
224  */
225 #define PGSTAT_MAX_MSG_SIZE 1000
226 #define PGSTAT_MSG_PAYLOAD (PGSTAT_MAX_MSG_SIZE - sizeof(PgStat_MsgHdr))
227 
228 
229 /* ----------
230  * PgStat_MsgDummy A dummy message, ignored by the collector
231  * ----------
232  */
233 typedef struct PgStat_MsgDummy
234 {
237 
238 
239 /* ----------
240  * PgStat_MsgInquiry Sent by a backend to ask the collector
241  * to write the stats file(s).
242  *
243  * Ordinarily, an inquiry message prompts writing of the global stats file,
244  * the stats file for shared catalogs, and the stats file for the specified
245  * database. If databaseid is InvalidOid, only the first two are written.
246  *
247  * New file(s) will be written only if the existing file has a timestamp
248  * older than the specified cutoff_time; this prevents duplicated effort
249  * when multiple requests arrive at nearly the same time, assuming that
250  * backends send requests with cutoff_times a little bit in the past.
251  *
252  * clock_time should be the requestor's current local time; the collector
253  * uses this to check for the system clock going backward, but it has no
254  * effect unless that occurs. We assume clock_time >= cutoff_time, though.
255  * ----------
256  */
257 
258 typedef struct PgStat_MsgInquiry
259 {
261  TimestampTz clock_time; /* observed local clock time */
262  TimestampTz cutoff_time; /* minimum acceptable file timestamp */
263  Oid databaseid; /* requested DB (InvalidOid => shared only) */
265 
266 
267 /* ----------
268  * PgStat_TableEntry Per-table info in a MsgTabstat
269  * ----------
270  */
271 typedef struct PgStat_TableEntry
272 {
276 
277 /* ----------
278  * PgStat_MsgTabstat Sent by the backend to report table
279  * and buffer access statistics.
280  * ----------
281  */
282 #define PGSTAT_NUM_TABENTRIES \
283  ((PGSTAT_MSG_PAYLOAD - sizeof(Oid) - 3 * sizeof(int) - 5 * sizeof(PgStat_Counter)) \
284  / sizeof(PgStat_TableEntry))
285 
286 typedef struct PgStat_MsgTabstat
287 {
293  PgStat_Counter m_block_read_time; /* times in microseconds */
300 
301 
302 /* ----------
303  * PgStat_MsgTabpurge Sent by the backend to tell the collector
304  * about dead tables.
305  * ----------
306  */
307 #define PGSTAT_NUM_TABPURGE \
308  ((PGSTAT_MSG_PAYLOAD - sizeof(Oid) - sizeof(int)) \
309  / sizeof(Oid))
310 
311 typedef struct PgStat_MsgTabpurge
312 {
318 
319 
320 /* ----------
321  * PgStat_MsgDropdb Sent by the backend to tell the collector
322  * about a dropped database
323  * ----------
324  */
325 typedef struct PgStat_MsgDropdb
326 {
330 
331 
332 /* ----------
333  * PgStat_MsgResetcounter Sent by the backend to tell the collector
334  * to reset counters
335  * ----------
336  */
338 {
342 
343 /* ----------
344  * PgStat_MsgResetsharedcounter Sent by the backend to tell the collector
345  * to reset a shared counter
346  * ----------
347  */
349 {
353 
354 /* ----------
355  * PgStat_MsgResetsinglecounter Sent by the backend to tell the collector
356  * to reset a single counter
357  * ----------
358  */
360 {
366 
367 /* ----------
368  * PgStat_MsgResetslrucounter Sent by the backend to tell the collector
369  * to reset a SLRU counter
370  * ----------
371  */
373 {
375  int m_index;
377 
378 /* ----------
379  * PgStat_MsgResetreplslotcounter Sent by the backend to tell the collector
380  * to reset replication slot counter(s)
381  * ----------
382  */
384 {
387  bool clearall;
389 
390 /* ----------
391  * PgStat_MsgAutovacStart Sent by the autovacuum daemon to signal
392  * that a database is going to be processed
393  * ----------
394  */
396 {
401 
402 
403 /* ----------
404  * PgStat_MsgVacuum Sent by the backend or autovacuum daemon
405  * after VACUUM
406  * ----------
407  */
408 typedef struct PgStat_MsgVacuum
409 {
418 
419 
420 /* ----------
421  * PgStat_MsgAnalyze Sent by the backend or autovacuum daemon
422  * after ANALYZE
423  * ----------
424  */
425 typedef struct PgStat_MsgAnalyze
426 {
436 
437 
438 /* ----------
439  * PgStat_MsgArchiver Sent by the archiver to update statistics.
440  * ----------
441  */
442 typedef struct PgStat_MsgArchiver
443 {
445  bool m_failed; /* Failed attempt */
446  char m_xlog[MAX_XFN_CHARS + 1];
449 
450 /* ----------
451  * PgStat_MsgBgWriter Sent by the bgwriter to update statistics.
452  * ----------
453  */
454 typedef struct PgStat_MsgBgWriter
455 {
457 
462 
463 /* ----------
464  * PgStat_MsgCheckpointer Sent by the checkpointer to update statistics.
465  * ----------
466  */
468 {
470 
476  PgStat_Counter m_checkpoint_write_time; /* times in milliseconds */
479 
480 /* ----------
481  * PgStat_MsgWal Sent by backends and background processes to update WAL statistics.
482  * ----------
483  */
484 typedef struct PgStat_MsgWal
485 {
489  uint64 m_wal_bytes;
493  PgStat_Counter m_wal_write_time; /* time spent writing wal records in
494  * microseconds */
495  PgStat_Counter m_wal_sync_time; /* time spent syncing wal records in
496  * microseconds */
497 } PgStat_MsgWal;
498 
499 /* ----------
500  * PgStat_MsgSLRU Sent by a backend to update SLRU statistics.
501  * ----------
502  */
503 typedef struct PgStat_MsgSLRU
504 {
515 
516 /* ----------
517  * PgStat_MsgReplSlot Sent by a backend or a wal sender to update replication
518  * slot statistics.
519  * ----------
520  */
521 typedef struct PgStat_MsgReplSlot
522 {
525  bool m_create;
526  bool m_drop;
536 
537 
538 /* ----------
539  * PgStat_MsgRecoveryConflict Sent by the backend upon recovery conflict
540  * ----------
541  */
543 {
545 
547  int m_reason;
549 
550 /* ----------
551  * PgStat_MsgTempFile Sent by the backend upon creating a temp file
552  * ----------
553  */
554 typedef struct PgStat_MsgTempFile
555 {
557 
559  size_t m_filesize;
561 
562 /* ----------
563  * PgStat_FunctionCounts The actual per-function counts kept by a backend
564  *
565  * This struct should contain only actual event counters, because we memcmp
566  * it against zeroes to detect whether there are any counts to transmit.
567  *
568  * Note that the time counters are in instr_time format here. We convert to
569  * microseconds in PgStat_Counter format when transmitting to the collector.
570  * ----------
571  */
572 typedef struct PgStat_FunctionCounts
573 {
578 
579 /* ----------
580  * PgStat_BackendFunctionEntry Entry in backend's per-function hash table
581  * ----------
582  */
584 {
588 
589 /* ----------
590  * PgStat_FunctionEntry Per-function info in a MsgFuncstat
591  * ----------
592  */
593 typedef struct PgStat_FunctionEntry
594 {
597  PgStat_Counter f_total_time; /* times in microseconds */
600 
601 /* ----------
602  * PgStat_MsgFuncstat Sent by the backend to report function
603  * usage statistics.
604  * ----------
605  */
606 #define PGSTAT_NUM_FUNCENTRIES \
607  ((PGSTAT_MSG_PAYLOAD - sizeof(Oid) - sizeof(int)) \
608  / sizeof(PgStat_FunctionEntry))
609 
610 typedef struct PgStat_MsgFuncstat
611 {
617 
618 /* ----------
619  * PgStat_MsgFuncpurge Sent by the backend to tell the collector
620  * about dead functions.
621  * ----------
622  */
623 #define PGSTAT_NUM_FUNCPURGE \
624  ((PGSTAT_MSG_PAYLOAD - sizeof(Oid) - sizeof(int)) \
625  / sizeof(Oid))
626 
627 typedef struct PgStat_MsgFuncpurge
628 {
632  Oid m_functionid[PGSTAT_NUM_FUNCPURGE];
634 
635 /* ----------
636  * PgStat_MsgDeadlock Sent by the backend to tell the collector
637  * about a deadlock that occurred.
638  * ----------
639  */
640 typedef struct PgStat_MsgDeadlock
641 {
645 
646 /* ----------
647  * PgStat_MsgChecksumFailure Sent by the backend to tell the collector
648  * about checksum failures noticed.
649  * ----------
650  */
652 {
658 
659 /* ----------
660  * PgStat_MsgConnect Sent by the backend upon connection
661  * establishment
662  * ----------
663  */
664 typedef struct PgStat_MsgConnect
665 {
669 
670 /* ----------
671  * PgStat_MsgDisconnect Sent by the backend when disconnecting
672  * ----------
673  */
674 typedef struct PgStat_MsgDisconnect
675 {
680 
681 /* ----------
682  * PgStat_Msg Union over all possible messages.
683  * ----------
684  */
685 typedef union PgStat_Msg
686 {
715 } PgStat_Msg;
716 
717 
718 /* ------------------------------------------------------------
719  * Statistic collector data structures follow
720  *
721  * PGSTAT_FILE_FORMAT_ID should be changed whenever any of these
722  * data structures change.
723  * ------------------------------------------------------------
724  */
725 
726 #define PGSTAT_FILE_FORMAT_ID 0x01A5BCA4
727 
728 /* ----------
729  * PgStat_StatDBEntry The collector's data per database
730  * ----------
731  */
732 typedef struct PgStat_StatDBEntry
733 {
755  PgStat_Counter n_block_read_time; /* times in microseconds */
764 
766  TimestampTz stats_timestamp; /* time of db stats file update */
767 
768  /*
769  * tables and functions must be last in the struct, because we don't write
770  * the pointers out to the stats file.
771  */
775 
776 
777 /* ----------
778  * PgStat_StatTabEntry The collector's data per table (or index)
779  * ----------
780  */
781 typedef struct PgStat_StatTabEntry
782 {
784 
786 
789 
794 
799 
802 
803  TimestampTz vacuum_timestamp; /* user initiated vacuum */
805  TimestampTz autovac_vacuum_timestamp; /* autovacuum initiated */
807  TimestampTz analyze_timestamp; /* user initiated */
809  TimestampTz autovac_analyze_timestamp; /* autovacuum initiated */
812 
813 
814 /* ----------
815  * PgStat_StatFuncEntry The collector's data per function
816  * ----------
817  */
818 typedef struct PgStat_StatFuncEntry
819 {
821 
823 
824  PgStat_Counter f_total_time; /* times in microseconds */
827 
828 
829 /*
830  * Archiver statistics kept in the stats collector
831  */
832 typedef struct PgStat_ArchiverStats
833 {
834  PgStat_Counter archived_count; /* archival successes */
835  char last_archived_wal[MAX_XFN_CHARS + 1]; /* last WAL file
836  * archived */
837  TimestampTz last_archived_timestamp; /* last archival success time */
838  PgStat_Counter failed_count; /* failed archival attempts */
839  char last_failed_wal[MAX_XFN_CHARS + 1]; /* WAL file involved in
840  * last failure */
841  TimestampTz last_failed_timestamp; /* last archival failure time */
844 
845 /*
846  * Background writer statistics kept in the stats collector
847  */
848 typedef struct PgStat_BgWriterStats
849 {
855 
856 /*
857  * Checkpointer statistics kept in the stats collector
858  */
860 {
861  TimestampTz stats_timestamp; /* time of stats file update */
864  PgStat_Counter checkpoint_write_time; /* times in milliseconds */
870 
871 /*
872  * Global statistics kept in the stats collector
873  */
874 typedef struct PgStat_GlobalStats
875 {
876  TimestampTz stats_timestamp; /* time of stats file update */
877 
881 
882 /*
883  * WAL statistics kept in the stats collector
884  */
885 typedef struct PgStat_WalStats
886 {
889  uint64 wal_bytes;
897 
898 /*
899  * SLRU statistics kept in the stats collector
900  */
901 typedef struct PgStat_SLRUStats
902 {
912 
913 /*
914  * Replication slot statistics kept in the stats collector
915  */
917 {
929 
930 
931 /*
932  * Working state needed to accumulate per-function-call timing statistics.
933  */
935 {
936  /* Link to function's hashtable entry (must still be there at exit!) */
937  /* NULL means we are not tracking the current function call */
939  /* Total time previously charged to function, as of function start */
941  /* Backend-wide total time as of function start */
943  /* system clock as of function start */
946 
947 
948 /* ----------
949  * GUC parameters
950  * ----------
951  */
952 extern PGDLLIMPORT bool pgstat_track_counts;
954 extern char *pgstat_stat_directory;
955 extern char *pgstat_stat_tmpname;
956 extern char *pgstat_stat_filename;
957 
958 /*
959  * BgWriter statistics counters are updated directly by bgwriter and bufmgr
960  */
962 
963 /*
964  * Checkpointer statistics counters are updated directly by checkpointer and
965  * bufmgr.
966  */
968 
969 /*
970  * WAL statistics counter is updated by backends and background processes
971  */
972 extern PgStat_MsgWal WalStats;
973 
974 /*
975  * Updated by pgstat_count_buffer_*_time macros
976  */
979 
980 /*
981  * Updated by pgstat_count_conn_*_time macros, called by
982  * pgstat_report_activity().
983  */
986 
987 
988 /*
989  * Updated by the traffic cop and in errfinish()
990  */
992 
993 /* ----------
994  * Functions called from postmaster
995  * ----------
996  */
997 extern void pgstat_init(void);
998 extern int pgstat_start(void);
999 extern void pgstat_reset_all(void);
1000 extern void allow_immediate_pgstat_restart(void);
1001 
1002 #ifdef EXEC_BACKEND
1003 extern void PgstatCollectorMain(int argc, char *argv[]) pg_attribute_noreturn();
1004 #endif
1005 
1006 
1007 /* ----------
1008  * Functions called from backends
1009  * ----------
1010  */
1011 extern void pgstat_ping(void);
1012 
1013 extern void pgstat_report_stat(bool force);
1014 extern void pgstat_vacuum_stat(void);
1015 extern void pgstat_drop_database(Oid databaseid);
1016 
1017 extern void pgstat_clear_snapshot(void);
1018 extern void pgstat_reset_counters(void);
1019 extern void pgstat_reset_shared_counters(const char *);
1021 extern void pgstat_reset_slru_counter(const char *);
1022 extern void pgstat_reset_replslot_counter(const char *name);
1023 
1024 extern void pgstat_report_connect(Oid dboid);
1025 extern void pgstat_report_autovac(Oid dboid);
1026 extern void pgstat_report_vacuum(Oid tableoid, bool shared,
1027  PgStat_Counter livetuples, PgStat_Counter deadtuples);
1028 extern void pgstat_report_analyze(Relation rel,
1029  PgStat_Counter livetuples, PgStat_Counter deadtuples,
1030  bool resetcounter);
1031 
1032 extern void pgstat_report_recovery_conflict(int reason);
1033 extern void pgstat_report_deadlock(void);
1034 extern void pgstat_report_checksum_failures_in_db(Oid dboid, int failurecount);
1035 extern void pgstat_report_checksum_failure(void);
1036 extern void pgstat_report_replslot(const PgStat_StatReplSlotEntry *repSlotStat);
1037 extern void pgstat_report_replslot_create(const char *slotname);
1038 extern void pgstat_report_replslot_drop(const char *slotname);
1039 
1040 extern void pgstat_initialize(void);
1041 
1042 
1043 extern PgStat_TableStatus *find_tabstat_entry(Oid rel_id);
1045 
1046 extern void pgstat_initstats(Relation rel);
1047 
1048 /* nontransactional event counts are simple enough to inline */
1049 
1050 #define pgstat_count_heap_scan(rel) \
1051  do { \
1052  if ((rel)->pgstat_info != NULL) \
1053  (rel)->pgstat_info->t_counts.t_numscans++; \
1054  } while (0)
1055 #define pgstat_count_heap_getnext(rel) \
1056  do { \
1057  if ((rel)->pgstat_info != NULL) \
1058  (rel)->pgstat_info->t_counts.t_tuples_returned++; \
1059  } while (0)
1060 #define pgstat_count_heap_fetch(rel) \
1061  do { \
1062  if ((rel)->pgstat_info != NULL) \
1063  (rel)->pgstat_info->t_counts.t_tuples_fetched++; \
1064  } while (0)
1065 #define pgstat_count_index_scan(rel) \
1066  do { \
1067  if ((rel)->pgstat_info != NULL) \
1068  (rel)->pgstat_info->t_counts.t_numscans++; \
1069  } while (0)
1070 #define pgstat_count_index_tuples(rel, n) \
1071  do { \
1072  if ((rel)->pgstat_info != NULL) \
1073  (rel)->pgstat_info->t_counts.t_tuples_returned += (n); \
1074  } while (0)
1075 #define pgstat_count_buffer_read(rel) \
1076  do { \
1077  if ((rel)->pgstat_info != NULL) \
1078  (rel)->pgstat_info->t_counts.t_blocks_fetched++; \
1079  } while (0)
1080 #define pgstat_count_buffer_hit(rel) \
1081  do { \
1082  if ((rel)->pgstat_info != NULL) \
1083  (rel)->pgstat_info->t_counts.t_blocks_hit++; \
1084  } while (0)
1085 #define pgstat_count_buffer_read_time(n) \
1086  (pgStatBlockReadTime += (n))
1087 #define pgstat_count_buffer_write_time(n) \
1088  (pgStatBlockWriteTime += (n))
1089 #define pgstat_count_conn_active_time(n) \
1090  (pgStatActiveTime += (n))
1091 #define pgstat_count_conn_txn_idle_time(n) \
1092  (pgStatTransactionIdleTime += (n))
1093 
1095 extern void pgstat_count_heap_update(Relation rel, bool hot);
1096 extern void pgstat_count_heap_delete(Relation rel);
1097 extern void pgstat_count_truncate(Relation rel);
1098 extern void pgstat_update_heap_dead_tuples(Relation rel, int delta);
1099 
1101 extern void pgstat_init_function_usage(struct FunctionCallInfoBaseData *fcinfo,
1104  bool finalize);
1105 
1106 extern void AtEOXact_PgStat(bool isCommit, bool parallel);
1107 extern void AtEOSubXact_PgStat(bool isCommit, int nestDepth);
1108 
1109 extern void AtPrepare_PgStat(void);
1110 extern void PostPrepare_PgStat(void);
1111 
1112 extern void pgstat_twophase_postcommit(TransactionId xid, uint16 info,
1113  void *recdata, uint32 len);
1114 extern void pgstat_twophase_postabort(TransactionId xid, uint16 info,
1115  void *recdata, uint32 len);
1116 
1117 extern void pgstat_send_archiver(const char *xlog, bool failed);
1118 extern void pgstat_send_bgwriter(void);
1119 extern void pgstat_send_checkpointer(void);
1120 extern void pgstat_send_wal(bool force);
1121 
1122 /* ----------
1123  * Support functions for the SQL-callable functions to
1124  * generate the pgstat* views.
1125  * ----------
1126  */
1135 extern PgStat_SLRUStats *pgstat_fetch_slru(void);
1137 
1138 extern void pgstat_count_slru_page_zeroed(int slru_idx);
1139 extern void pgstat_count_slru_page_hit(int slru_idx);
1140 extern void pgstat_count_slru_page_read(int slru_idx);
1141 extern void pgstat_count_slru_page_written(int slru_idx);
1142 extern void pgstat_count_slru_page_exists(int slru_idx);
1143 extern void pgstat_count_slru_flush(int slru_idx);
1144 extern void pgstat_count_slru_truncate(int slru_idx);
1145 extern const char *pgstat_slru_name(int slru_idx);
1146 extern int pgstat_slru_index(const char *name);
1147 
1148 #endif /* PGSTAT_H */
void pgstat_report_checksum_failure(void)
Definition: pgstat.c:1724
struct PgStat_BgWriterStats PgStat_BgWriterStats
SessionEndType m_cause
Definition: pgstat.h:678
void pgstat_count_truncate(Relation rel)
Definition: pgstat.c:2340
PgStat_MsgResetslrucounter msg_resetslrucounter
Definition: pgstat.h:696
PgStat_MsgAutovacStart msg_autovacuum_start
Definition: pgstat.h:698
PgStat_MsgBgWriter msg_bgwriter
Definition: pgstat.h:702
PgStat_ArchiverStats * pgstat_fetch_stat_archiver(void)
Definition: pgstat.c:2836
void pgstat_initialize(void)
Definition: pgstat.c:2975
PgStat_Counter analyze_count
Definition: pgstat.h:808
instr_time f_self_time
Definition: pgstat.h:576
int pgstat_start(void)
Definition: pgstat.c:768
#define pg_attribute_noreturn()
Definition: c.h:179
instr_time f_start
Definition: pgstat.h:944
PgStat_Counter archived_count
Definition: pgstat.h:834
PgStat_MsgHdr m_hdr
Definition: pgstat.h:486
void pgstat_ping(void)
Definition: pgstat.c:1878
PgStat_Counter m_buf_alloc
Definition: pgstat.h:460
struct PgStat_MsgFuncpurge PgStat_MsgFuncpurge
PgStat_Counter t_delta_live_tuples
Definition: pgstat.h:128
PgStat_Counter m_dead_tuples
Definition: pgstat.h:416
void pgstat_clear_snapshot(void)
Definition: pgstat.c:4816
PgStat_Counter wal_records
Definition: pgstat.h:887
int64 PgStat_Counter
Definition: pgstat.h:92
PgStat_Counter wal_write
Definition: pgstat.h:891
PgStat_Counter m_buf_written_backend
Definition: pgstat.h:474
TimestampTz m_vacuumtime
Definition: pgstat.h:414
PgStat_Counter tuples_updated
Definition: pgstat.h:187
TimestampTz stat_reset_timestamp
Definition: pgstat.h:895
NON_EXEC_STATIC void PgstatCollectorMain(int argc, char *argv[]) pg_attribute_noreturn()
Definition: pgstat.c:3275
PgStat_Counter m_flush
Definition: pgstat.h:512
struct PgStat_MsgResetreplslotcounter PgStat_MsgResetreplslotcounter
PgStat_Counter tuples_returned
Definition: pgstat.h:787
struct PgStat_MsgConnect PgStat_MsgConnect
PgStat_MsgDeadlock msg_deadlock
Definition: pgstat.h:709
void pgstat_count_slru_page_exists(int slru_idx)
Definition: pgstat.c:5960
PgStat_Counter spill_bytes
Definition: pgstat.h:921
uint32 TransactionId
Definition: c.h:587
PgStat_MsgResetsharedcounter msg_resetsharedcounter
Definition: pgstat.h:694
union PgStat_Msg PgStat_Msg
TimestampTz stats_timestamp
Definition: pgstat.h:766
TimestampTz stats_timestamp
Definition: pgstat.h:861
TrackFunctionsLevel
Definition: pgstat.h:36
PgStat_MsgHdr m_hdr
Definition: pgstat.h:666
PgStat_Counter t_tuples_fetched
Definition: pgstat.h:120
PgStat_Counter requested_checkpoints
Definition: pgstat.h:863
PgStat_MsgHdr m_hdr
Definition: pgstat.h:556
PgStat_MsgChecksumFailure msg_checksumfailure
Definition: pgstat.h:711
PgStat_Counter m_live_tuples
Definition: pgstat.h:415
void pgstat_count_slru_page_written(int slru_idx)
Definition: pgstat.c:5972
void pgstat_send_wal(bool force)
Definition: pgstat.c:3142
TimestampTz clock_time
Definition: pgstat.h:261
instr_time save_total
Definition: pgstat.h:942
PgStat_Counter n_blocks_hit
Definition: pgstat.h:738
int64 TimestampTz
Definition: timestamp.h:39
#define PGSTAT_NUM_TABPURGE
Definition: pgstat.h:307
struct PgStat_MsgTabpurge PgStat_MsgTabpurge
void pgstat_update_heap_dead_tuples(Relation rel, int delta)
Definition: pgstat.c:2369
struct PgStat_StatReplSlotEntry PgStat_StatReplSlotEntry
PgStat_MsgHdr m_hdr
Definition: pgstat.h:397
struct PgStat_MsgArchiver PgStat_MsgArchiver
PgStat_Counter n_conflict_bufferpin
Definition: pgstat.h:748
PgStat_Counter m_maxwritten_clean
Definition: pgstat.h:459
PgStat_Counter n_conflict_startup_deadlock
Definition: pgstat.h:749
PgStat_Counter t_tuples_hot_updated
Definition: pgstat.h:125
PgStat_MsgHdr m_hdr
Definition: pgstat.h:456
TimestampTz autovac_analyze_timestamp
Definition: pgstat.h:809
PgStat_Counter wal_sync_time
Definition: pgstat.h:894
struct PgStat_MsgDeadlock PgStat_MsgDeadlock
struct timeval instr_time
Definition: instr_time.h:150
PgStat_Counter f_self_time
Definition: pgstat.h:598
TimestampTz stat_reset_timestamp
Definition: pgstat.h:910
PgStat_MsgHdr m_hdr
Definition: pgstat.h:629
PgStat_Counter n_checksum_failures
Definition: pgstat.h:753
PgStat_Counter n_temp_files
Definition: pgstat.h:750
PgStat_MsgHdr m_hdr
Definition: pgstat.h:653
Oid m_databaseid
Definition: pgstat.h:411
PgStat_BgWriterStats bgwriter
Definition: pgstat.h:879
PgStat_Counter m_buf_written_clean
Definition: pgstat.h:458
PgStat_MsgDummy msg_dummy
Definition: pgstat.h:688
TimestampTz last_checksum_failure
Definition: pgstat.h:754
PgStat_Counter m_wal_sync
Definition: pgstat.h:492
uint64 m_wal_bytes
Definition: pgstat.h:489
PgStat_Counter m_spill_bytes
Definition: pgstat.h:529
HTAB * functions
Definition: pgstat.h:773
PgStat_GlobalStats * pgstat_fetch_global(void)
Definition: pgstat.c:2884
void pgstat_report_connect(Oid dboid)
Definition: pgstat.c:1756
void pgstat_reset_replslot_counter(const char *name)
Definition: pgstat.c:1526
PgStat_SLRUStats * pgstat_fetch_slru(void)
Definition: pgstat.c:2916
PgStat_Counter n_tuples_returned
Definition: pgstat.h:739
struct PgStat_MsgReplSlot PgStat_MsgReplSlot
PgStat_Counter vacuum_count
Definition: pgstat.h:804
bool m_autovacuum
Definition: pgstat.h:413
void pgstat_send_archiver(const char *xlog, bool failed)
Definition: pgstat.c:3052
size_t m_filesize
Definition: pgstat.h:559
PgStat_MsgTempFile msg_tempfile
Definition: pgstat.h:710
struct PgStat_TableCounts PgStat_TableCounts
void pgstat_report_replslot(const PgStat_StatReplSlotEntry *repSlotStat)
Definition: pgstat.c:1813
struct PgStat_MsgDummy PgStat_MsgDummy
TimestampTz stats_timestamp
Definition: pgstat.h:876
TimestampTz stat_reset_timestamp
Definition: pgstat.h:765
PgStat_MsgWal msg_wal
Definition: pgstat.h:704
instr_time f_total_time
Definition: pgstat.h:575
void pgstat_reset_slru_counter(const char *)
Definition: pgstat.c:1502
PgStat_Counter m_checkpoint_sync_time
Definition: pgstat.h:477
struct PgStat_TableXactStatus * next
Definition: pgstat.h:198
TimestampTz m_analyzetime
Definition: pgstat.h:432
void pgstat_twophase_postcommit(TransactionId xid, uint16 info, void *recdata, uint32 len)
Definition: pgstat.c:2653
PgStat_Counter numscans
Definition: pgstat.h:785
struct PgStat_MsgDisconnect PgStat_MsgDisconnect
PgStat_TableCounts t_counts
Definition: pgstat.h:177
PgStat_Counter blocks_exists
Definition: pgstat.h:907
struct PgStat_MsgRecoveryConflict PgStat_MsgRecoveryConflict
unsigned int Oid
Definition: postgres_ext.h:31
struct PgStat_ArchiverStats PgStat_ArchiverStats
PgStat_Counter deleted_pre_trunc
Definition: pgstat.h:192
PgStat_Counter m_blocks_exists
Definition: pgstat.h:511
PgStat_Counter checkpoint_write_time
Definition: pgstat.h:864
PgStat_MsgAnalyze msg_analyze
Definition: pgstat.h:700
PgStat_Counter tuples_hot_updated
Definition: pgstat.h:793
PgStat_Counter f_total_time
Definition: pgstat.h:824
PgStat_Counter t_tuples_returned
Definition: pgstat.h:119
PgStat_Shared_Reset_Target
Definition: pgstat.h:137
PgStat_Counter tuples_inserted
Definition: pgstat.h:790
PgStat_FunctionCounts * fs
Definition: pgstat.h:938
PgStat_Counter f_numcalls
Definition: pgstat.h:574
PgStat_Counter m_wal_sync_time
Definition: pgstat.h:495
PgStat_MsgHdr msg_hdr
Definition: pgstat.h:687
TimestampTz stat_reset_timestamp
Definition: pgstat.h:853
struct PgStat_StatFuncEntry PgStat_StatFuncEntry
struct PgStat_FunctionCallUsage PgStat_FunctionCallUsage
#define PGDLLIMPORT
Definition: c.h:1317
struct PgStat_SLRUStats PgStat_SLRUStats
PgStat_Counter m_stream_bytes
Definition: pgstat.h:532
PgStat_StatTabEntry * pgstat_fetch_stat_tabentry(Oid relid)
Definition: pgstat.c:2750
PgStat_Counter n_xact_commit
Definition: pgstat.h:735
void pgstat_report_deadlock(void)
Definition: pgstat.c:1681
PgStat_MsgWal WalStats
Definition: pgstat.c:133
bool m_resetcounter
Definition: pgstat.h:431
PgStat_MsgHdr m_hdr
Definition: pgstat.h:505
PgStat_Counter n_blocks_fetched
Definition: pgstat.h:737
PgStat_Counter n_sessions_killed
Definition: pgstat.h:763
struct PgStat_TableEntry PgStat_TableEntry
const char * pgstat_slru_name(int slru_idx)
Definition: pgstat.c:5913
PgStat_Counter n_live_tuples
Definition: pgstat.h:795
PgStat_Counter inserts_since_vacuum
Definition: pgstat.h:798
Definition: dynahash.c:219
struct PgStat_MsgAnalyze PgStat_MsgAnalyze
unsigned short uint16
Definition: c.h:440
PgStat_MsgSLRU msg_slru
Definition: pgstat.h:705
PgStat_FunctionCounts f_counts
Definition: pgstat.h:586
PgStat_MsgHdr m_hdr
Definition: pgstat.h:642
PgStat_TableStatus * find_tabstat_entry(Oid rel_id)
Definition: pgstat.c:2170
PgStat_MsgFuncpurge msg_funcpurge
Definition: pgstat.h:707
char * pgstat_stat_tmpname
Definition: pgstat.c:124
PgStat_Counter n_conflict_tablespace
Definition: pgstat.h:745
PgStat_Counter m_spill_txns
Definition: pgstat.h:527
PgStat_Counter wal_write_time
Definition: pgstat.h:893
void AtEOSubXact_PgStat(bool isCommit, int nestDepth)
Definition: pgstat.c:2472
TimestampTz vacuum_timestamp
Definition: pgstat.h:803
PgStat_Counter t_tuples_updated
Definition: pgstat.h:123
PgStat_Counter buf_written_backend
Definition: pgstat.h:867
PgStat_MsgHdr m_hdr
Definition: pgstat.h:374
PgStat_MsgHdr m_hdr
Definition: pgstat.h:544
PgStat_Counter total_active_time
Definition: pgstat.h:759
PgStat_Counter pgStatBlockReadTime
Definition: pgstat.c:247
void pgstat_reset_single_counter(Oid objectid, PgStat_Single_Reset_Type type)
Definition: pgstat.c:1476
PgStat_Counter n_sessions_abandoned
Definition: pgstat.h:761
PgStat_Counter n_dead_tuples
Definition: pgstat.h:796
PgStat_Counter m_idle_in_xact_time
Definition: pgstat.h:297
PgStat_Counter m_index
Definition: pgstat.h:506
PgStat_Counter wal_fpi
Definition: pgstat.h:888
Definition: c.h:675
PgStat_Counter maxwritten_clean
Definition: pgstat.h:851
TimestampTz m_failure_time
Definition: pgstat.h:656
struct PgStat_MsgTempFile PgStat_MsgTempFile
void allow_immediate_pgstat_restart(void)
Definition: pgstat.c:831
PgStat_Counter f_numcalls
Definition: pgstat.h:822
PgStat_MsgCheckpointer msg_checkpointer
Definition: pgstat.h:703
TimestampTz last_autovac_time
Definition: pgstat.h:744
struct PgStat_GlobalStats PgStat_GlobalStats
void pgstat_count_slru_page_read(int slru_idx)
Definition: pgstat.c:5966
PgStat_Counter m_blocks_written
Definition: pgstat.h:510
PgStat_Counter n_sessions_fatal
Definition: pgstat.h:762
PgStat_Counter n_tuples_inserted
Definition: pgstat.h:741
Oid m_databaseid
Definition: pgstat.h:328
PgStat_Counter tuples_inserted
Definition: pgstat.h:186
struct PgStat_MsgDropdb PgStat_MsgDropdb
PgStat_Counter pgStatBlockWriteTime
Definition: pgstat.c:248
struct PgStat_MsgSLRU PgStat_MsgSLRU
PgStat_Counter m_timed_checkpoints
Definition: pgstat.h:471
struct PgStat_MsgInquiry PgStat_MsgInquiry
void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu, bool finalize)
Definition: pgstat.c:1986
char * pgstat_stat_directory
Definition: pgstat.c:122
PgStat_Counter total_bytes
Definition: pgstat.h:926
PgStat_Counter blocks_read
Definition: pgstat.h:905
PgStat_Counter total_idle_in_xact_time
Definition: pgstat.h:760
void pgstat_report_stat(bool force)
Definition: pgstat.c:857
PgStat_Counter buf_alloc
Definition: pgstat.h:852
PgStat_MsgCheckpointer PendingCheckpointerStats
Definition: pgstat.c:132
void pgstat_vacuum_stat(void)
Definition: pgstat.c:1117
PgStat_Counter m_buf_written_checkpoints
Definition: pgstat.h:473
PgStat_Counter m_wal_write_time
Definition: pgstat.h:493
PgStat_Counter t_delta_dead_tuples
Definition: pgstat.h:129
SessionEndType
Definition: pgstat.h:44
PgStat_Counter tuples_fetched
Definition: pgstat.h:788
void pgstat_count_heap_insert(Relation rel, PgStat_Counter n)
Definition: pgstat.c:2239
unsigned int uint32
Definition: c.h:441
TimestampTz stat_reset_timestamp
Definition: pgstat.h:927
PgStat_Counter n_conflict_snapshot
Definition: pgstat.h:747
PgStat_Counter m_checkpoint_write_time
Definition: pgstat.h:476
PgStat_MsgConnect msg_connect
Definition: pgstat.h:713
PgStat_MsgHdr m_hdr
Definition: pgstat.h:327
PgStat_Counter m_block_write_time
Definition: pgstat.h:294
PgStat_Counter n_tuples_deleted
Definition: pgstat.h:743
void pgstat_twophase_postabort(TransactionId xid, uint16 info, void *recdata, uint32 len)
Definition: pgstat.c:2689
PgStat_Counter n_conflict_lock
Definition: pgstat.h:746
PgStat_Counter blocks_hit
Definition: pgstat.h:904
PgStat_Counter total_session_time
Definition: pgstat.h:758
PgStat_Counter t_blocks_hit
Definition: pgstat.h:133
PgStat_Counter pgStatActiveTime
Definition: pgstat.c:250
void pgstat_init(void)
Definition: pgstat.c:391
struct PgStat_WalStats PgStat_WalStats
struct PgStat_TableXactStatus * upper
Definition: pgstat.h:195
PgStat_Counter n_xact_rollback
Definition: pgstat.h:736
PgStat_Counter m_wal_buffers_full
Definition: pgstat.h:490
int m_xact_rollback
Definition: pgstat.h:292
PgStat_MsgHdr m_hdr
Definition: pgstat.h:339
SessionEndType pgStatSessionEndCause
Definition: pgstat.c:252
PgStat_Counter t_tuples_deleted
Definition: pgstat.h:124
void AtEOXact_PgStat(bool isCommit, bool parallel)
Definition: pgstat.c:2385
void pgstat_report_recovery_conflict(int reason)
Definition: pgstat.c:1661
PgStat_Counter blocks_zeroed
Definition: pgstat.h:903
PgStat_MsgRecoveryConflict msg_recoveryconflict
Definition: pgstat.h:708
struct PgStat_MsgTabstat PgStat_MsgTabstat
PgStat_Counter m_buf_fsync_backend
Definition: pgstat.h:475
PgStat_MsgHdr m_hdr
Definition: pgstat.h:313
PgStat_Counter m_wal_write
Definition: pgstat.h:491
PgStat_Counter m_live_tuples
Definition: pgstat.h:433
void pgstat_drop_database(Oid databaseid)
Definition: pgstat.c:1366
void pgstat_count_slru_truncate(int slru_idx)
Definition: pgstat.c:5984
PgStat_CheckpointerStats * pgstat_fetch_stat_checkpointer(void)
Definition: pgstat.c:2868
struct PgStat_MsgResetsharedcounter PgStat_MsgResetsharedcounter
struct PgStat_FunctionCounts PgStat_FunctionCounts
PgStat_CheckpointerStats checkpointer
Definition: pgstat.h:878
bool m_autovacuum
Definition: pgstat.h:430
#define PGSTAT_NUM_FUNCENTRIES
Definition: pgstat.h:606
PgStat_Counter tuples_deleted
Definition: pgstat.h:188
struct PgStat_MsgBgWriter PgStat_MsgBgWriter
TimestampTz m_timestamp
Definition: pgstat.h:447
#define PGSTAT_NUM_TABENTRIES
Definition: pgstat.h:282
struct PgStat_MsgResetsinglecounter PgStat_MsgResetsinglecounter
void pgstat_reset_counters(void)
Definition: pgstat.c:1421
#define MAX_XFN_CHARS
Definition: pgarch.h:26
PgStat_Counter f_total_time
Definition: pgstat.h:597
PgStat_Counter blocks_hit
Definition: pgstat.h:801
void pgstat_send_checkpointer(void)
Definition: pgstat.c:3107
TimestampTz analyze_timestamp
Definition: pgstat.h:807
TimestampTz last_failed_timestamp
Definition: pgstat.h:841
PgStat_Counter m_requested_checkpoints
Definition: pgstat.h:472
PgStat_Counter changes_since_analyze
Definition: pgstat.h:797
PgStat_BgWriterStats * pgstat_fetch_stat_bgwriter(void)
Definition: pgstat.c:2852
StatMsgType
Definition: pgstat.h:57
PgStat_Shared_Reset_Target m_resettarget
Definition: pgstat.h:351
void pgstat_report_vacuum(Oid tableoid, bool shared, PgStat_Counter livetuples, PgStat_Counter deadtuples)
Definition: pgstat.c:1577
PgStat_Counter t_numscans
Definition: pgstat.h:117
struct PgStat_MsgVacuum PgStat_MsgVacuum
PgStat_Single_Reset_Type
Definition: pgstat.h:145
struct PgStat_TableXactStatus PgStat_TableXactStatus
PgStat_Counter stream_bytes
Definition: pgstat.h:924
PGDLLIMPORT bool pgstat_track_counts
Definition: pgstat.c:115
PgStat_Counter spill_txns
Definition: pgstat.h:919
PgStat_Counter n_tuples_updated
Definition: pgstat.h:742
PgStat_Counter buf_written_checkpoints
Definition: pgstat.h:866
PgStat_Counter pgStatTransactionIdleTime
Definition: pgstat.c:251
uint64 wal_bytes
Definition: pgstat.h:889
PgStat_Counter m_stream_txns
Definition: pgstat.h:530
void pgstat_report_replslot_drop(const char *slotname)
Definition: pgstat.c:1860
char * pgstat_stat_filename
Definition: pgstat.c:123
PgStat_MsgHdr m_hdr
Definition: pgstat.h:235
PgStat_Counter t_changed_tuples
Definition: pgstat.h:130
struct PgStat_MsgWal PgStat_MsgWal
PgStat_MsgTabstat msg_tabstat
Definition: pgstat.h:690
PgStat_MsgHdr m_hdr
Definition: pgstat.h:288
void pgstat_send_bgwriter(void)
Definition: pgstat.c:3073
struct PgStat_MsgChecksumFailure PgStat_MsgChecksumFailure
PgStat_MsgVacuum msg_vacuum
Definition: pgstat.h:699
PgStat_MsgHdr m_hdr
Definition: pgstat.h:612
PgStat_Counter n_sessions
Definition: pgstat.h:757
PgStat_Counter failed_count
Definition: pgstat.h:838
PgStat_StatDBEntry * pgstat_fetch_stat_dbentry(Oid dbid)
Definition: pgstat.c:2723
PgStat_Counter n_block_write_time
Definition: pgstat.h:756
PgStat_MsgHdr m_hdr
Definition: pgstat.h:469
PgStat_Counter m_blocks_read
Definition: pgstat.h:509
PgStat_Counter buf_written_clean
Definition: pgstat.h:850
PgStat_MsgHdr m_hdr
Definition: pgstat.h:410
PgStat_Counter m_total_txns
Definition: pgstat.h:533
void pgstat_count_heap_delete(Relation rel)
Definition: pgstat.c:2285
PgStat_Counter tuples_deleted
Definition: pgstat.h:792
struct PgStat_StatTabEntry PgStat_StatTabEntry
PgStat_Counter m_wal_fpi
Definition: pgstat.h:488
PgStat_TableCounts t_counts
Definition: pgstat.h:274
PgStat_Counter flush
Definition: pgstat.h:908
void pgstat_count_slru_flush(int slru_idx)
Definition: pgstat.c:5978
PgStat_Counter m_active_time
Definition: pgstat.h:296
PgStat_Counter inserted_pre_trunc
Definition: pgstat.h:190
PgStat_Counter tuples_updated
Definition: pgstat.h:791
PgStat_Counter m_spill_count
Definition: pgstat.h:528
PgStat_Counter timed_checkpoints
Definition: pgstat.h:862
struct PgStat_MsgCheckpointer PgStat_MsgCheckpointer
PgStat_Counter m_session_time
Definition: pgstat.h:295
PgStat_Counter m_total_bytes
Definition: pgstat.h:534
struct PgStat_FunctionEntry PgStat_FunctionEntry
TimestampTz autovac_vacuum_timestamp
Definition: pgstat.h:805
PgStat_Counter n_block_read_time
Definition: pgstat.h:755
PgStat_Counter m_block_read_time
Definition: pgstat.h:293
struct PgStat_MsgFuncstat PgStat_MsgFuncstat
const char * name
Definition: encode.c:561
PgStat_Counter spill_count
Definition: pgstat.h:920
PgStat_MsgBgWriter PendingBgWriterStats
Definition: pgstat.c:131
struct PgStat_TableXactStatus * trans
Definition: pgstat.h:176
struct PgStat_TableStatus PgStat_TableStatus
PgStat_MsgResetreplslotcounter msg_resetreplslotcounter
Definition: pgstat.h:697
struct PgStat_StatDBEntry PgStat_StatDBEntry
PgStat_Counter autovac_analyze_count
Definition: pgstat.h:810
void pgstat_report_autovac(Oid dboid)
Definition: pgstat.c:1555
int pgstat_slru_index(const char *name)
Definition: pgstat.c:5891
PgStat_Counter updated_pre_trunc
Definition: pgstat.h:191
void pgstat_count_slru_page_hit(int slru_idx)
Definition: pgstat.c:5954
PgStat_MsgHdr m_hdr
Definition: pgstat.h:427
void pgstat_report_checksum_failures_in_db(Oid dboid, int failurecount)
Definition: pgstat.c:1702
void pgstat_count_heap_update(Relation rel, bool hot)
Definition: pgstat.c:2260
PgStat_BackendFunctionEntry * find_funcstat_entry(Oid func_id)
Definition: pgstat.c:1964
void pgstat_init_function_usage(struct FunctionCallInfoBaseData *fcinfo, PgStat_FunctionCallUsage *fcu)
TimestampTz cutoff_time
Definition: pgstat.h:262
TimestampTz stat_reset_timestamp
Definition: pgstat.h:842
TimestampTz last_archived_timestamp
Definition: pgstat.h:837
TimestampTz m_start_time
Definition: pgstat.h:399
PgStat_Counter n_deadlocks
Definition: pgstat.h:752
struct PgStat_MsgResetslrucounter PgStat_MsgResetslrucounter
struct PgStat_MsgAutovacStart PgStat_MsgAutovacStart
PgStat_Counter stream_count
Definition: pgstat.h:923
PgStat_MsgArchiver msg_archiver
Definition: pgstat.h:701
PgStat_Counter buf_fsync_backend
Definition: pgstat.h:868
PgStat_StatReplSlotEntry * pgstat_fetch_replslot(NameData slotname)
Definition: pgstat.c:2932
void pgstat_report_analyze(Relation rel, PgStat_Counter livetuples, PgStat_Counter deadtuples, bool resetcounter)
Definition: pgstat.c:1605
PgStat_MsgResetsinglecounter msg_resetsinglecounter
Definition: pgstat.h:695
StatMsgType m_type
Definition: pgstat.h:214
void pgstat_report_replslot_create(const char *slotname)
Definition: pgstat.c:1842
PgStat_MsgHdr m_hdr
Definition: pgstat.h:523
PgStat_StatFuncEntry * pgstat_fetch_stat_funcentry(Oid funcid)
Definition: pgstat.c:2806
instr_time save_f_total_time
Definition: pgstat.h:940
PgStat_MsgResetcounter msg_resetcounter
Definition: pgstat.h:693
PgStat_MsgHdr m_hdr
Definition: pgstat.h:676
PgStat_Counter total_txns
Definition: pgstat.h:925
void pgstat_reset_all(void)
Definition: pgstat.c:726
PgStat_WalStats * pgstat_fetch_stat_wal(void)
Definition: pgstat.c:2900
PgStat_Counter m_stream_count
Definition: pgstat.h:531
PgStat_Counter m_blocks_zeroed
Definition: pgstat.h:507
NameData m_slotname
Definition: pgstat.h:524
PgStat_MsgReplSlot msg_replslot
Definition: pgstat.h:712
PgStat_Counter f_numcalls
Definition: pgstat.h:596
PgStat_MsgDisconnect msg_disconnect
Definition: pgstat.h:714
struct PgStat_MsgResetcounter PgStat_MsgResetcounter
PgStat_Counter wal_buffers_full
Definition: pgstat.h:890
PgStat_Counter f_self_time
Definition: pgstat.h:825
PgStat_Counter m_dead_tuples
Definition: pgstat.h:434
PgStat_Counter wal_sync
Definition: pgstat.h:892
PgStat_Counter blocks_fetched
Definition: pgstat.h:800
PgStat_Counter m_truncate
Definition: pgstat.h:513
void AtPrepare_PgStat(void)
Definition: pgstat.c:2571
struct PgStat_BackendFunctionEntry PgStat_BackendFunctionEntry
struct PgStat_MsgHdr PgStat_MsgHdr
PgStat_MsgInquiry msg_inquiry
Definition: pgstat.h:689
PgStat_Counter truncate
Definition: pgstat.h:909
PgStat_MsgDropdb msg_dropdb
Definition: pgstat.h:692
int m_size
Definition: pgstat.h:215
PgStat_Single_Reset_Type m_resettype
Definition: pgstat.h:363
void pgstat_initstats(Relation rel)
Definition: pgstat.c:2043
void pgstat_count_slru_page_zeroed(int slru_idx)
Definition: pgstat.c:5948
PgStat_Counter t_tuples_inserted
Definition: pgstat.h:122
void pgstat_reset_shared_counters(const char *)
Definition: pgstat.c:1443
PgStat_Counter blocks_written
Definition: pgstat.h:906
PgStat_MsgTabpurge msg_tabpurge
Definition: pgstat.h:691
PgStat_Counter checkpoint_sync_time
Definition: pgstat.h:865
struct PgStat_CheckpointerStats PgStat_CheckpointerStats
#define PGSTAT_NUM_FUNCPURGE
Definition: pgstat.h:623
PgStat_TableStatus * parent
Definition: pgstat.h:196
PGDLLIMPORT int pgstat_track_functions
Definition: pgstat.c:116
PgStat_Counter t_blocks_fetched
Definition: pgstat.h:132
PgStat_MsgHdr m_hdr
Definition: pgstat.h:444
void PostPrepare_PgStat(void)
Definition: pgstat.c:2620
PgStat_MsgFuncstat msg_funcstat
Definition: pgstat.h:706
PgStat_Counter m_blocks_hit
Definition: pgstat.h:508
PgStat_Counter n_tuples_fetched
Definition: pgstat.h:740
PgStat_Counter autovac_vacuum_count
Definition: pgstat.h:806
PgStat_MsgHdr m_hdr
Definition: pgstat.h:260
PgStat_Counter stream_txns
Definition: pgstat.h:922
PgStat_Counter m_wal_records
Definition: pgstat.h:487
PgStat_Counter n_temp_bytes
Definition: pgstat.h:751