Coverage Report

Created: 2026-09-28 06:55

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/postgres/src/include/executor/instrument_node.h
Line
Count
Source
1
/*-------------------------------------------------------------------------
2
 *
3
 * instrument_node.h
4
 *    Definitions for node-specific support for parallel query instrumentation
5
 *
6
 * These structs purposely contain no pointers because they are copied
7
 * across processes during parallel query execution.  Each worker copies its
8
 * individual information into the container struct at executor shutdown time,
9
 * to allow the leader to display the information in EXPLAIN ANALYZE.
10
 *
11
 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
12
 * Portions Copyright (c) 1994, Regents of the University of California
13
 *
14
 * src/include/executor/instrument_node.h
15
 *
16
 *-------------------------------------------------------------------------
17
 */
18
#ifndef INSTRUMENT_NODE_H
19
#define INSTRUMENT_NODE_H
20
21
/*
22
 * Offset added to plan_node_id to create a second TOC key for per-worker scan
23
 * instrumentation. Instrumentation and parallel-awareness are independent, so
24
 * separate DSM chunks let each be allocated and initialized only when needed.
25
 * In the future, if nodes need more DSM allocations, we would need a more
26
 * robust system.
27
 */
28
0
#define PARALLEL_KEY_SCAN_INSTRUMENT_OFFSET UINT64CONST(0xD000000000000000)
29
30
/* ---------------------
31
 *  Instrumentation information for aggregate function execution
32
 * ---------------------
33
 */
34
typedef struct AggregateInstrumentation
35
{
36
  Size    hash_mem_peak;  /* peak hash table memory usage */
37
  uint64    hash_disk_used; /* kB of disk space used */
38
  int     hash_batches_used;  /* batches used during entire execution */
39
} AggregateInstrumentation;
40
41
/*
42
 * Shared memory container for per-worker aggregate information
43
 */
44
typedef struct SharedAggInfo
45
{
46
  int     num_workers;
47
  AggregateInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER];
48
} SharedAggInfo;
49
50
51
/* ---------------------
52
 *  Instrumentation information about read streams and I/O
53
 * ---------------------
54
 */
55
typedef struct IOStats
56
{
57
  /* number of buffers returned to consumer (for averaging distance) */
58
  uint64    prefetch_count;
59
60
  /* sum of pinned_buffers sampled at each buffer return */
61
  uint64    distance_sum;
62
63
  /* maximum actual pinned_buffers observed during the scan */
64
  int16   distance_max;
65
66
  /* maximum possible look-ahead distance (max_pinned_buffers) */
67
  int16   distance_capacity;
68
69
  /* number of waits for a read (for the I/O) */
70
  uint64    wait_count;
71
72
  /* I/O stats */
73
  uint64    io_count;   /* number of I/Os */
74
  uint64    io_nblocks;   /* sum of blocks for all I/Os */
75
  uint64    io_in_progress; /* sum of in-progress I/Os */
76
} IOStats;
77
78
typedef struct TableScanInstrumentation
79
{
80
  IOStats   io;
81
} TableScanInstrumentation;
82
83
/* merge IO statistics from 'src' into 'dst' */
84
static inline void
85
AccumulateIOStats(IOStats *dst, IOStats *src)
86
0
{
87
0
  dst->prefetch_count += src->prefetch_count;
88
0
  dst->distance_sum += src->distance_sum;
89
0
  if (src->distance_max > dst->distance_max)
90
0
    dst->distance_max = src->distance_max;
91
0
  if (src->distance_capacity > dst->distance_capacity)
92
0
    dst->distance_capacity = src->distance_capacity;
93
0
  dst->wait_count += src->wait_count;
94
0
  dst->io_count += src->io_count;
95
0
  dst->io_nblocks += src->io_nblocks;
96
0
  dst->io_in_progress += src->io_in_progress;
97
0
}
Unexecuted instantiation: fuzzer_initialize.c:AccumulateIOStats
Unexecuted instantiation: brin.c:AccumulateIOStats
Unexecuted instantiation: brin_bloom.c:AccumulateIOStats
Unexecuted instantiation: brin_inclusion.c:AccumulateIOStats
Unexecuted instantiation: brin_minmax.c:AccumulateIOStats
Unexecuted instantiation: brin_minmax_multi.c:AccumulateIOStats
Unexecuted instantiation: brin_pageops.c:AccumulateIOStats
Unexecuted instantiation: brin_revmap.c:AccumulateIOStats
Unexecuted instantiation: brin_tuple.c:AccumulateIOStats
Unexecuted instantiation: brin_validate.c:AccumulateIOStats
Unexecuted instantiation: brin_xlog.c:AccumulateIOStats
Unexecuted instantiation: printtup.c:AccumulateIOStats
Unexecuted instantiation: reloptions.c:AccumulateIOStats
Unexecuted instantiation: toast_internals.c:AccumulateIOStats
Unexecuted instantiation: ginbtree.c:AccumulateIOStats
Unexecuted instantiation: ginbulk.c:AccumulateIOStats
Unexecuted instantiation: gindatapage.c:AccumulateIOStats
Unexecuted instantiation: ginentrypage.c:AccumulateIOStats
Unexecuted instantiation: ginfast.c:AccumulateIOStats
Unexecuted instantiation: ginget.c:AccumulateIOStats
Unexecuted instantiation: gininsert.c:AccumulateIOStats
Unexecuted instantiation: ginlogic.c:AccumulateIOStats
Unexecuted instantiation: ginpostinglist.c:AccumulateIOStats
Unexecuted instantiation: ginscan.c:AccumulateIOStats
Unexecuted instantiation: ginutil.c:AccumulateIOStats
Unexecuted instantiation: ginvacuum.c:AccumulateIOStats
Unexecuted instantiation: ginvalidate.c:AccumulateIOStats
Unexecuted instantiation: ginxlog.c:AccumulateIOStats
Unexecuted instantiation: gist.c:AccumulateIOStats
Unexecuted instantiation: gistbuild.c:AccumulateIOStats
Unexecuted instantiation: gistbuildbuffers.c:AccumulateIOStats
Unexecuted instantiation: gistget.c:AccumulateIOStats
Unexecuted instantiation: gistscan.c:AccumulateIOStats
Unexecuted instantiation: gistsplit.c:AccumulateIOStats
Unexecuted instantiation: gistutil.c:AccumulateIOStats
Unexecuted instantiation: gistvacuum.c:AccumulateIOStats
Unexecuted instantiation: gistvalidate.c:AccumulateIOStats
Unexecuted instantiation: gistxlog.c:AccumulateIOStats
Unexecuted instantiation: hash.c:AccumulateIOStats
Unexecuted instantiation: hash_xlog.c:AccumulateIOStats
Unexecuted instantiation: hashinsert.c:AccumulateIOStats
Unexecuted instantiation: hashovfl.c:AccumulateIOStats
Unexecuted instantiation: hashpage.c:AccumulateIOStats
Unexecuted instantiation: hashsearch.c:AccumulateIOStats
Unexecuted instantiation: hashsort.c:AccumulateIOStats
Unexecuted instantiation: hashutil.c:AccumulateIOStats
Unexecuted instantiation: hashvalidate.c:AccumulateIOStats
Unexecuted instantiation: heapam.c:AccumulateIOStats
Unexecuted instantiation: heapam_handler.c:AccumulateIOStats
Unexecuted instantiation: heapam_indexscan.c:AccumulateIOStats
Unexecuted instantiation: heaptoast.c:AccumulateIOStats
Unexecuted instantiation: pruneheap.c:AccumulateIOStats
Unexecuted instantiation: vacuumlazy.c:AccumulateIOStats
Unexecuted instantiation: amapi.c:AccumulateIOStats
Unexecuted instantiation: genam.c:AccumulateIOStats
Unexecuted instantiation: indexam.c:AccumulateIOStats
Unexecuted instantiation: nbtdedup.c:AccumulateIOStats
Unexecuted instantiation: nbtinsert.c:AccumulateIOStats
Unexecuted instantiation: nbtpage.c:AccumulateIOStats
Unexecuted instantiation: nbtpreprocesskeys.c:AccumulateIOStats
Unexecuted instantiation: nbtreadpage.c:AccumulateIOStats
Unexecuted instantiation: nbtree.c:AccumulateIOStats
Unexecuted instantiation: nbtsearch.c:AccumulateIOStats
Unexecuted instantiation: nbtsort.c:AccumulateIOStats
Unexecuted instantiation: nbtsplitloc.c:AccumulateIOStats
Unexecuted instantiation: nbtutils.c:AccumulateIOStats
Unexecuted instantiation: nbtvalidate.c:AccumulateIOStats
Unexecuted instantiation: nbtxlog.c:AccumulateIOStats
Unexecuted instantiation: spgdoinsert.c:AccumulateIOStats
Unexecuted instantiation: spginsert.c:AccumulateIOStats
Unexecuted instantiation: spgkdtreeproc.c:AccumulateIOStats
Unexecuted instantiation: spgproc.c:AccumulateIOStats
Unexecuted instantiation: spgquadtreeproc.c:AccumulateIOStats
Unexecuted instantiation: spgscan.c:AccumulateIOStats
Unexecuted instantiation: spgtextproc.c:AccumulateIOStats
Unexecuted instantiation: spgutils.c:AccumulateIOStats
Unexecuted instantiation: spgvacuum.c:AccumulateIOStats
Unexecuted instantiation: spgvalidate.c:AccumulateIOStats
Unexecuted instantiation: spgxlog.c:AccumulateIOStats
Unexecuted instantiation: tableam_indexscan.c:AccumulateIOStats
Unexecuted instantiation: bernoulli.c:AccumulateIOStats
Unexecuted instantiation: system.c:AccumulateIOStats
Unexecuted instantiation: tablesample.c:AccumulateIOStats
Unexecuted instantiation: commit_ts.c:AccumulateIOStats
Unexecuted instantiation: parallel.c:AccumulateIOStats
Unexecuted instantiation: rmgr.c:AccumulateIOStats
Unexecuted instantiation: twophase.c:AccumulateIOStats
Unexecuted instantiation: xact.c:AccumulateIOStats
Unexecuted instantiation: xlogfuncs.c:AccumulateIOStats
Unexecuted instantiation: xlogprefetcher.c:AccumulateIOStats
Unexecuted instantiation: bootparse.c:AccumulateIOStats
Unexecuted instantiation: bootscanner.c:AccumulateIOStats
Unexecuted instantiation: bootstrap.c:AccumulateIOStats
Unexecuted instantiation: aclchk.c:AccumulateIOStats
Unexecuted instantiation: catalog.c:AccumulateIOStats
Unexecuted instantiation: dependency.c:AccumulateIOStats
Unexecuted instantiation: heap.c:AccumulateIOStats
Unexecuted instantiation: index.c:AccumulateIOStats
Unexecuted instantiation: indexing.c:AccumulateIOStats
Unexecuted instantiation: namespace.c:AccumulateIOStats
Unexecuted instantiation: objectaddress.c:AccumulateIOStats
Unexecuted instantiation: partition.c:AccumulateIOStats
Unexecuted instantiation: pg_attrdef.c:AccumulateIOStats
Unexecuted instantiation: pg_constraint.c:AccumulateIOStats
Unexecuted instantiation: pg_db_role_setting.c:AccumulateIOStats
Unexecuted instantiation: pg_depend.c:AccumulateIOStats
Unexecuted instantiation: pg_enum.c:AccumulateIOStats
Unexecuted instantiation: pg_inherits.c:AccumulateIOStats
Unexecuted instantiation: pg_largeobject.c:AccumulateIOStats
Unexecuted instantiation: pg_proc.c:AccumulateIOStats
Unexecuted instantiation: pg_publication.c:AccumulateIOStats
Unexecuted instantiation: pg_range.c:AccumulateIOStats
Unexecuted instantiation: pg_shdepend.c:AccumulateIOStats
Unexecuted instantiation: pg_subscription.c:AccumulateIOStats
Unexecuted instantiation: toasting.c:AccumulateIOStats
Unexecuted instantiation: analyze.c:AccumulateIOStats
Unexecuted instantiation: gram.c:AccumulateIOStats
Unexecuted instantiation: parse_agg.c:AccumulateIOStats
Unexecuted instantiation: parse_clause.c:AccumulateIOStats
Unexecuted instantiation: parse_coerce.c:AccumulateIOStats
Unexecuted instantiation: parse_collate.c:AccumulateIOStats
Unexecuted instantiation: parse_expr.c:AccumulateIOStats
Unexecuted instantiation: parse_func.c:AccumulateIOStats
Unexecuted instantiation: parse_jsontable.c:AccumulateIOStats
Unexecuted instantiation: parse_merge.c:AccumulateIOStats
Unexecuted instantiation: parse_node.c:AccumulateIOStats
Unexecuted instantiation: parse_relation.c:AccumulateIOStats
Unexecuted instantiation: parse_target.c:AccumulateIOStats
Unexecuted instantiation: parse_type.c:AccumulateIOStats
Unexecuted instantiation: parse_utilcmd.c:AccumulateIOStats
Unexecuted instantiation: alter.c:AccumulateIOStats
Unexecuted instantiation: async.c:AccumulateIOStats
Unexecuted instantiation: comment.c:AccumulateIOStats
Unexecuted instantiation: constraint.c:AccumulateIOStats
Unexecuted instantiation: copy.c:AccumulateIOStats
Unexecuted instantiation: copyfrom.c:AccumulateIOStats
Unexecuted instantiation: copyfromparse.c:AccumulateIOStats
Unexecuted instantiation: copyto.c:AccumulateIOStats
Unexecuted instantiation: createas.c:AccumulateIOStats
Unexecuted instantiation: dbcommands.c:AccumulateIOStats
Unexecuted instantiation: define.c:AccumulateIOStats
Unexecuted instantiation: discard.c:AccumulateIOStats
Unexecuted instantiation: event_trigger.c:AccumulateIOStats
Unexecuted instantiation: explain.c:AccumulateIOStats
Unexecuted instantiation: explain_dr.c:AccumulateIOStats
Unexecuted instantiation: explain_format.c:AccumulateIOStats
Unexecuted instantiation: explain_state.c:AccumulateIOStats
Unexecuted instantiation: extension.c:AccumulateIOStats
Unexecuted instantiation: foreigncmds.c:AccumulateIOStats
Unexecuted instantiation: functioncmds.c:AccumulateIOStats
Unexecuted instantiation: indexcmds.c:AccumulateIOStats
Unexecuted instantiation: matview.c:AccumulateIOStats
Unexecuted instantiation: opclasscmds.c:AccumulateIOStats
Unexecuted instantiation: policy.c:AccumulateIOStats
Unexecuted instantiation: portalcmds.c:AccumulateIOStats
Unexecuted instantiation: prepare.c:AccumulateIOStats
Unexecuted instantiation: repack.c:AccumulateIOStats
Unexecuted instantiation: repack_worker.c:AccumulateIOStats
Unexecuted instantiation: seclabel.c:AccumulateIOStats
Unexecuted instantiation: sequence.c:AccumulateIOStats
Unexecuted instantiation: statscmds.c:AccumulateIOStats
Unexecuted instantiation: subscriptioncmds.c:AccumulateIOStats
Unexecuted instantiation: tablecmds.c:AccumulateIOStats
Unexecuted instantiation: tablespace.c:AccumulateIOStats
Unexecuted instantiation: trigger.c:AccumulateIOStats
Unexecuted instantiation: tsearchcmds.c:AccumulateIOStats
Unexecuted instantiation: typecmds.c:AccumulateIOStats
Unexecuted instantiation: user.c:AccumulateIOStats
Unexecuted instantiation: vacuum.c:AccumulateIOStats
Unexecuted instantiation: vacuumparallel.c:AccumulateIOStats
Unexecuted instantiation: view.c:AccumulateIOStats
Unexecuted instantiation: wait.c:AccumulateIOStats
Unexecuted instantiation: execAmi.c:AccumulateIOStats
Unexecuted instantiation: execAsync.c:AccumulateIOStats
Unexecuted instantiation: execCurrent.c:AccumulateIOStats
Unexecuted instantiation: execExpr.c:AccumulateIOStats
Unexecuted instantiation: execExprInterp.c:AccumulateIOStats
Unexecuted instantiation: execGrouping.c:AccumulateIOStats
Unexecuted instantiation: execIndexing.c:AccumulateIOStats
Unexecuted instantiation: execJunk.c:AccumulateIOStats
Unexecuted instantiation: execMain.c:AccumulateIOStats
Unexecuted instantiation: execParallel.c:AccumulateIOStats
Unexecuted instantiation: execPartition.c:AccumulateIOStats
Unexecuted instantiation: execProcnode.c:AccumulateIOStats
Unexecuted instantiation: execReplication.c:AccumulateIOStats
Unexecuted instantiation: execSRF.c:AccumulateIOStats
Unexecuted instantiation: execScan.c:AccumulateIOStats
Unexecuted instantiation: execTuples.c:AccumulateIOStats
Unexecuted instantiation: execUtils.c:AccumulateIOStats
Unexecuted instantiation: functions.c:AccumulateIOStats
Unexecuted instantiation: instrument.c:AccumulateIOStats
Unexecuted instantiation: nodeAgg.c:AccumulateIOStats
Unexecuted instantiation: nodeAppend.c:AccumulateIOStats
Unexecuted instantiation: nodeBitmapAnd.c:AccumulateIOStats
Unexecuted instantiation: nodeBitmapHeapscan.c:AccumulateIOStats
Unexecuted instantiation: nodeBitmapIndexscan.c:AccumulateIOStats
Unexecuted instantiation: nodeBitmapOr.c:AccumulateIOStats
Unexecuted instantiation: nodeCtescan.c:AccumulateIOStats
Unexecuted instantiation: nodeCustom.c:AccumulateIOStats
Unexecuted instantiation: nodeForeignscan.c:AccumulateIOStats
Unexecuted instantiation: nodeFunctionscan.c:AccumulateIOStats
Unexecuted instantiation: nodeGather.c:AccumulateIOStats
Unexecuted instantiation: nodeGatherMerge.c:AccumulateIOStats
Unexecuted instantiation: nodeGroup.c:AccumulateIOStats
Unexecuted instantiation: nodeHash.c:AccumulateIOStats
Unexecuted instantiation: nodeHashjoin.c:AccumulateIOStats
Unexecuted instantiation: nodeIncrementalSort.c:AccumulateIOStats
Unexecuted instantiation: nodeIndexonlyscan.c:AccumulateIOStats
Unexecuted instantiation: nodeIndexscan.c:AccumulateIOStats
Unexecuted instantiation: nodeLimit.c:AccumulateIOStats
Unexecuted instantiation: nodeLockRows.c:AccumulateIOStats
Unexecuted instantiation: nodeMaterial.c:AccumulateIOStats
Unexecuted instantiation: nodeMemoize.c:AccumulateIOStats
Unexecuted instantiation: nodeMergeAppend.c:AccumulateIOStats
Unexecuted instantiation: nodeMergejoin.c:AccumulateIOStats
Unexecuted instantiation: nodeModifyTable.c:AccumulateIOStats
Unexecuted instantiation: nodeNamedtuplestorescan.c:AccumulateIOStats
Unexecuted instantiation: nodeNestloop.c:AccumulateIOStats
Unexecuted instantiation: nodeProjectSet.c:AccumulateIOStats
Unexecuted instantiation: nodeRecursiveunion.c:AccumulateIOStats
Unexecuted instantiation: nodeResult.c:AccumulateIOStats
Unexecuted instantiation: nodeSamplescan.c:AccumulateIOStats
Unexecuted instantiation: nodeSeqscan.c:AccumulateIOStats
Unexecuted instantiation: nodeSetOp.c:AccumulateIOStats
Unexecuted instantiation: nodeSort.c:AccumulateIOStats
Unexecuted instantiation: nodeSubplan.c:AccumulateIOStats
Unexecuted instantiation: nodeSubqueryscan.c:AccumulateIOStats
Unexecuted instantiation: nodeTableFuncscan.c:AccumulateIOStats
Unexecuted instantiation: nodeTidrangescan.c:AccumulateIOStats
Unexecuted instantiation: nodeTidscan.c:AccumulateIOStats
Unexecuted instantiation: nodeUnique.c:AccumulateIOStats
Unexecuted instantiation: nodeValuesscan.c:AccumulateIOStats
Unexecuted instantiation: nodeWindowAgg.c:AccumulateIOStats
Unexecuted instantiation: nodeWorktablescan.c:AccumulateIOStats
Unexecuted instantiation: spi.c:AccumulateIOStats
Unexecuted instantiation: foreign.c:AccumulateIOStats
Unexecuted instantiation: copyfuncs.c:AccumulateIOStats
Unexecuted instantiation: equalfuncs.c:AccumulateIOStats
Unexecuted instantiation: extensible.c:AccumulateIOStats
Unexecuted instantiation: makefuncs.c:AccumulateIOStats
Unexecuted instantiation: nodeFuncs.c:AccumulateIOStats
Unexecuted instantiation: outfuncs.c:AccumulateIOStats
Unexecuted instantiation: print.c:AccumulateIOStats
Unexecuted instantiation: queryjumblefuncs.c:AccumulateIOStats
Unexecuted instantiation: readfuncs.c:AccumulateIOStats
Unexecuted instantiation: allpaths.c:AccumulateIOStats
Unexecuted instantiation: clausesel.c:AccumulateIOStats
Unexecuted instantiation: costsize.c:AccumulateIOStats
Unexecuted instantiation: equivclass.c:AccumulateIOStats
Unexecuted instantiation: indxpath.c:AccumulateIOStats
Unexecuted instantiation: joinpath.c:AccumulateIOStats
Unexecuted instantiation: analyzejoins.c:AccumulateIOStats
Unexecuted instantiation: createplan.c:AccumulateIOStats
Unexecuted instantiation: initsplan.c:AccumulateIOStats
Unexecuted instantiation: planagg.c:AccumulateIOStats
Unexecuted instantiation: planner.c:AccumulateIOStats
Unexecuted instantiation: setrefs.c:AccumulateIOStats
Unexecuted instantiation: subselect.c:AccumulateIOStats
Unexecuted instantiation: prepjointree.c:AccumulateIOStats
Unexecuted instantiation: prepqual.c:AccumulateIOStats
Unexecuted instantiation: preptlist.c:AccumulateIOStats
Unexecuted instantiation: prepunion.c:AccumulateIOStats
Unexecuted instantiation: appendinfo.c:AccumulateIOStats
Unexecuted instantiation: clauses.c:AccumulateIOStats
Unexecuted instantiation: inherit.c:AccumulateIOStats
Unexecuted instantiation: joininfo.c:AccumulateIOStats
Unexecuted instantiation: orclauses.c:AccumulateIOStats
Unexecuted instantiation: pathnode.c:AccumulateIOStats
Unexecuted instantiation: plancat.c:AccumulateIOStats
Unexecuted instantiation: predtest.c:AccumulateIOStats
Unexecuted instantiation: relnode.c:AccumulateIOStats
Unexecuted instantiation: restrictinfo.c:AccumulateIOStats
Unexecuted instantiation: tlist.c:AccumulateIOStats
Unexecuted instantiation: partbounds.c:AccumulateIOStats
Unexecuted instantiation: partdesc.c:AccumulateIOStats
Unexecuted instantiation: partprune.c:AccumulateIOStats
Unexecuted instantiation: autovacuum.c:AccumulateIOStats
Unexecuted instantiation: datachecksum_state.c:AccumulateIOStats
Unexecuted instantiation: applyparallelworker.c:AccumulateIOStats
Unexecuted instantiation: conflict.c:AccumulateIOStats
Unexecuted instantiation: launcher.c:AccumulateIOStats
Unexecuted instantiation: logicalfuncs.c:AccumulateIOStats
Unexecuted instantiation: origin.c:AccumulateIOStats
Unexecuted instantiation: relation.c:AccumulateIOStats
Unexecuted instantiation: sequencesync.c:AccumulateIOStats
Unexecuted instantiation: syncutils.c:AccumulateIOStats
Unexecuted instantiation: tablesync.c:AccumulateIOStats
Unexecuted instantiation: worker.c:AccumulateIOStats
Unexecuted instantiation: repl_gram.c:AccumulateIOStats
Unexecuted instantiation: slotfuncs.c:AccumulateIOStats
Unexecuted instantiation: walreceiver.c:AccumulateIOStats
Unexecuted instantiation: walsender.c:AccumulateIOStats
Unexecuted instantiation: rewriteHandler.c:AccumulateIOStats
Unexecuted instantiation: rewriteManip.c:AccumulateIOStats
Unexecuted instantiation: rewriteRemove.c:AccumulateIOStats
Unexecuted instantiation: rewriteSearchCycle.c:AccumulateIOStats
Unexecuted instantiation: rowsecurity.c:AccumulateIOStats
Unexecuted instantiation: basebackup_copy.c:AccumulateIOStats
Unexecuted instantiation: walsummaryfuncs.c:AccumulateIOStats
Unexecuted instantiation: attribute_stats.c:AccumulateIOStats
Unexecuted instantiation: dependencies.c:AccumulateIOStats
Unexecuted instantiation: extended_stats.c:AccumulateIOStats
Unexecuted instantiation: extended_stats_funcs.c:AccumulateIOStats
Unexecuted instantiation: mcv.c:AccumulateIOStats
Unexecuted instantiation: mvdistinct.c:AccumulateIOStats
Unexecuted instantiation: relation_stats.c:AccumulateIOStats
Unexecuted instantiation: stat_utils.c:AccumulateIOStats
Unexecuted instantiation: aio_funcs.c:AccumulateIOStats
Unexecuted instantiation: read_stream.c:AccumulateIOStats
Unexecuted instantiation: dsm_registry.c:AccumulateIOStats
Unexecuted instantiation: shmem.c:AccumulateIOStats
Unexecuted instantiation: inv_api.c:AccumulateIOStats
Unexecuted instantiation: dest.c:AccumulateIOStats
Unexecuted instantiation: postgres.c:AccumulateIOStats
Unexecuted instantiation: pquery.c:AccumulateIOStats
Unexecuted instantiation: utility.c:AccumulateIOStats
Unexecuted instantiation: ts_typanalyze.c:AccumulateIOStats
Unexecuted instantiation: wparser.c:AccumulateIOStats
Unexecuted instantiation: pgstat_kind.c:AccumulateIOStats
Unexecuted instantiation: pgstat_subscription.c:AccumulateIOStats
Unexecuted instantiation: wait_event_funcs.c:AccumulateIOStats
Unexecuted instantiation: acl.c:AccumulateIOStats
Unexecuted instantiation: amutils.c:AccumulateIOStats
Unexecuted instantiation: array_typanalyze.c:AccumulateIOStats
Unexecuted instantiation: array_userfuncs.c:AccumulateIOStats
Unexecuted instantiation: arrayfuncs.c:AccumulateIOStats
Unexecuted instantiation: arraysubs.c:AccumulateIOStats
Unexecuted instantiation: datetime.c:AccumulateIOStats
Unexecuted instantiation: ddlutils.c:AccumulateIOStats
Unexecuted instantiation: domains.c:AccumulateIOStats
Unexecuted instantiation: enum.c:AccumulateIOStats
Unexecuted instantiation: genfile.c:AccumulateIOStats
Unexecuted instantiation: geo_spgist.c:AccumulateIOStats
Unexecuted instantiation: hbafuncs.c:AccumulateIOStats
Unexecuted instantiation: int.c:AccumulateIOStats
Unexecuted instantiation: int8.c:AccumulateIOStats
Unexecuted instantiation: json.c:AccumulateIOStats
Unexecuted instantiation: jsonb.c:AccumulateIOStats
Unexecuted instantiation: jsonfuncs.c:AccumulateIOStats
Unexecuted instantiation: jsonbsubs.c:AccumulateIOStats
Unexecuted instantiation: jsonpath_exec.c:AccumulateIOStats
Unexecuted instantiation: like_support.c:AccumulateIOStats
Unexecuted instantiation: lockfuncs.c:AccumulateIOStats
Unexecuted instantiation: mcxtfuncs.c:AccumulateIOStats
Unexecuted instantiation: misc.c:AccumulateIOStats
Unexecuted instantiation: multirangetypes.c:AccumulateIOStats
Unexecuted instantiation: multixactfuncs.c:AccumulateIOStats
Unexecuted instantiation: network.c:AccumulateIOStats
Unexecuted instantiation: network_spgist.c:AccumulateIOStats
Unexecuted instantiation: numeric.c:AccumulateIOStats
Unexecuted instantiation: orderedsetaggs.c:AccumulateIOStats
Unexecuted instantiation: partitionfuncs.c:AccumulateIOStats
Unexecuted instantiation: pg_dependencies.c:AccumulateIOStats
Unexecuted instantiation: pg_ndistinct.c:AccumulateIOStats
Unexecuted instantiation: pg_upgrade_support.c:AccumulateIOStats
Unexecuted instantiation: pgstatfuncs.c:AccumulateIOStats
Unexecuted instantiation: rangetypes.c:AccumulateIOStats
Unexecuted instantiation: rangetypes_spgist.c:AccumulateIOStats
Unexecuted instantiation: rangetypes_typanalyze.c:AccumulateIOStats
Unexecuted instantiation: regexp.c:AccumulateIOStats
Unexecuted instantiation: ri_triggers.c:AccumulateIOStats
Unexecuted instantiation: rowtypes.c:AccumulateIOStats
Unexecuted instantiation: ruleutils.c:AccumulateIOStats
Unexecuted instantiation: selfuncs.c:AccumulateIOStats
Unexecuted instantiation: skipsupport.c:AccumulateIOStats
Unexecuted instantiation: timestamp.c:AccumulateIOStats
Unexecuted instantiation: trigfuncs.c:AccumulateIOStats
Unexecuted instantiation: tsgistidx.c:AccumulateIOStats
Unexecuted instantiation: tsquery_rewrite.c:AccumulateIOStats
Unexecuted instantiation: tsvector_op.c:AccumulateIOStats
Unexecuted instantiation: varlena.c:AccumulateIOStats
Unexecuted instantiation: xid8funcs.c:AccumulateIOStats
Unexecuted instantiation: xml.c:AccumulateIOStats
Unexecuted instantiation: attoptcache.c:AccumulateIOStats
Unexecuted instantiation: catcache.c:AccumulateIOStats
Unexecuted instantiation: evtcache.c:AccumulateIOStats
Unexecuted instantiation: funccache.c:AccumulateIOStats
Unexecuted instantiation: lsyscache.c:AccumulateIOStats
Unexecuted instantiation: partcache.c:AccumulateIOStats
Unexecuted instantiation: plancache.c:AccumulateIOStats
Unexecuted instantiation: relcache.c:AccumulateIOStats
Unexecuted instantiation: relfilenumbermap.c:AccumulateIOStats
Unexecuted instantiation: spccache.c:AccumulateIOStats
Unexecuted instantiation: ts_cache.c:AccumulateIOStats
Unexecuted instantiation: typcache.c:AccumulateIOStats
Unexecuted instantiation: fmgr.c:AccumulateIOStats
Unexecuted instantiation: funcapi.c:AccumulateIOStats
Unexecuted instantiation: postinit.c:AccumulateIOStats
Unexecuted instantiation: guc_funcs.c:AccumulateIOStats
Unexecuted instantiation: guc_tables.c:AccumulateIOStats
Unexecuted instantiation: pg_config.c:AccumulateIOStats
Unexecuted instantiation: pg_controldata.c:AccumulateIOStats
Unexecuted instantiation: portalmem.c:AccumulateIOStats
Unexecuted instantiation: sortsupport.c:AccumulateIOStats
Unexecuted instantiation: tuplesort.c:AccumulateIOStats
Unexecuted instantiation: tuplesortvariants.c:AccumulateIOStats
Unexecuted instantiation: tuplestore.c:AccumulateIOStats
Unexecuted instantiation: jit.c:AccumulateIOStats
Unexecuted instantiation: simple_query_fuzzer.c:AccumulateIOStats
98
99
100
/* ---------------------
101
 *  Instrumentation information for index scans (used by all AM interfaces)
102
 * ---------------------
103
 */
104
typedef struct IndexScanInstrumentation
105
{
106
  /* Index search count (incremented with pgstat_count_index_scan call) */
107
  uint64    nsearches;
108
109
  /* Table tuples fetched count (incremented during index-only scans) */
110
  uint64    ntabletuplefetches;
111
} IndexScanInstrumentation;
112
113
/*
114
 * Shared memory container for per-worker information
115
 */
116
typedef struct SharedIndexScanInstrumentation
117
{
118
  int     num_workers;
119
  IndexScanInstrumentation winstrument[FLEXIBLE_ARRAY_MEMBER];
120
} SharedIndexScanInstrumentation;
121
122
123
/* ---------------------
124
 *  Instrumentation information for bitmap heap scans
125
 *
126
 *    exact_pages      total number of exact pages retrieved
127
 *    lossy_pages      total number of lossy pages retrieved
128
 * ---------------------
129
 */
130
typedef struct BitmapHeapScanInstrumentation
131
{
132
  uint64    exact_pages;
133
  uint64    lossy_pages;
134
  TableScanInstrumentation stats;
135
} BitmapHeapScanInstrumentation;
136
137
/*
138
 * Shared memory container for per-worker information
139
 */
140
typedef struct SharedBitmapHeapInstrumentation
141
{
142
  int     num_workers;
143
  BitmapHeapScanInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER];
144
} SharedBitmapHeapInstrumentation;
145
146
147
/* ---------------------
148
 *  Instrumentation information for Memoize
149
 * ---------------------
150
 */
151
typedef struct MemoizeInstrumentation
152
{
153
  uint64    cache_hits;   /* number of rescans where we've found the
154
                 * scan parameters values to be cached */
155
  uint64    cache_misses; /* number of rescans where we've not found the
156
                 * scan parameters values to be cached */
157
  uint64    cache_evictions;  /* number of cache entries removed due to
158
                   * the need to free memory */
159
  uint64    cache_overflows;  /* number of times we've had to bypass the
160
                   * cache when filling it due to not being
161
                   * able to free enough space to store the
162
                   * current scan's tuples */
163
  uint64    mem_peak;   /* peak memory usage in bytes */
164
} MemoizeInstrumentation;
165
166
/*
167
 * Shared memory container for per-worker memoize information
168
 */
169
typedef struct SharedMemoizeInfo
170
{
171
  int     num_workers;
172
  MemoizeInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER];
173
} SharedMemoizeInfo;
174
175
176
/* ---------------------
177
 *  Instrumentation information for Sorts.
178
 * ---------------------
179
 */
180
181
typedef enum
182
{
183
  SORT_SPACE_TYPE_DISK,
184
  SORT_SPACE_TYPE_MEMORY,
185
} TuplesortSpaceType;
186
187
/*
188
 * The parallel-sort infrastructure relies on having a zero TuplesortMethod
189
 * to indicate that a worker never did anything, so we assign zero to
190
 * SORT_TYPE_STILL_IN_PROGRESS.  The other values of this enum can be
191
 * OR'ed together to represent a situation where different workers used
192
 * different methods, so we need a separate bit for each one.  Keep the
193
 * NUM_TUPLESORTMETHODS constant in sync with the number of bits!
194
 */
195
typedef enum
196
{
197
  SORT_TYPE_STILL_IN_PROGRESS = 0,
198
  SORT_TYPE_TOP_N_HEAPSORT = 1 << 0,
199
  SORT_TYPE_QUICKSORT = 1 << 1,
200
  SORT_TYPE_EXTERNAL_SORT = 1 << 2,
201
  SORT_TYPE_EXTERNAL_MERGE = 1 << 3,
202
} TuplesortMethod;
203
0
#define NUM_TUPLESORTMETHODS 4
204
205
typedef struct TuplesortInstrumentation
206
{
207
  TuplesortMethod sortMethod; /* sort algorithm used */
208
  TuplesortSpaceType spaceType; /* type of space spaceUsed represents */
209
  int64   spaceUsed;    /* space consumption, in kB */
210
} TuplesortInstrumentation;
211
212
/*
213
 * Shared memory container for per-worker sort information
214
 */
215
typedef struct SharedSortInfo
216
{
217
  int     num_workers;
218
  TuplesortInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER];
219
} SharedSortInfo;
220
221
222
/* ---------------------
223
 *   Instrumentation information for nodeHash.c
224
 * ---------------------
225
 */
226
typedef struct HashInstrumentation
227
{
228
  int     nbuckets;   /* number of buckets at end of execution */
229
  int     nbuckets_original;  /* planned number of buckets */
230
  int     nbatch;     /* number of batches at end of execution */
231
  int     nbatch_original;  /* planned number of batches */
232
  Size    space_peak;   /* peak memory usage in bytes */
233
} HashInstrumentation;
234
235
/*
236
 * Shared memory container for per-worker information
237
 */
238
typedef struct SharedHashInfo
239
{
240
  int     num_workers;
241
  HashInstrumentation hinstrument[FLEXIBLE_ARRAY_MEMBER];
242
} SharedHashInfo;
243
244
245
/* ---------------------
246
 *   Instrumentation information for IncrementalSort
247
 * ---------------------
248
 */
249
typedef struct IncrementalSortGroupInfo
250
{
251
  int64   groupCount;
252
  int64   maxDiskSpaceUsed;
253
  int64   totalDiskSpaceUsed;
254
  int64   maxMemorySpaceUsed;
255
  int64   totalMemorySpaceUsed;
256
  uint32    sortMethods;  /* bitmask of TuplesortMethod */
257
} IncrementalSortGroupInfo;
258
259
typedef struct IncrementalSortInfo
260
{
261
  IncrementalSortGroupInfo fullsortGroupInfo;
262
  IncrementalSortGroupInfo prefixsortGroupInfo;
263
} IncrementalSortInfo;
264
265
/* Shared memory container for per-worker incremental sort information */
266
typedef struct SharedIncrementalSortInfo
267
{
268
  int     num_workers;
269
  IncrementalSortInfo sinfo[FLEXIBLE_ARRAY_MEMBER];
270
} SharedIncrementalSortInfo;
271
272
273
/* ---------------------
274
 *  Instrumentation information for sequential scans
275
 * ---------------------
276
 */
277
typedef struct SeqScanInstrumentation
278
{
279
  TableScanInstrumentation stats;
280
} SeqScanInstrumentation;
281
282
/*
283
 * Shared memory container for per-worker information
284
 */
285
typedef struct SharedSeqScanInstrumentation
286
{
287
  int     num_workers;
288
  SeqScanInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER];
289
} SharedSeqScanInstrumentation;
290
291
292
/*
293
 *  Instrumentation information for TID range scans
294
 */
295
typedef struct TidRangeScanInstrumentation
296
{
297
  TableScanInstrumentation stats;
298
} TidRangeScanInstrumentation;
299
300
/*
301
 * Shared memory container for per-worker information
302
 */
303
typedef struct SharedTidRangeScanInstrumentation
304
{
305
  int     num_workers;
306
  TidRangeScanInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER];
307
} SharedTidRangeScanInstrumentation;
308
309
#endif              /* INSTRUMENT_NODE_H */