PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/xact.h"
#include "pgstat.h"
#include "utils/memutils.h"
#include "utils/pgstat_internal.h"
Go to the source code of this file.
Data Structures | |
struct | PgStat_PendingDroppedStatsItem |
Typedefs | |
typedef struct PgStat_PendingDroppedStatsItem | PgStat_PendingDroppedStatsItem |
Functions | |
static void | AtEOXact_PgStat_DroppedStats (PgStat_SubXactStatus *xact_state, bool isCommit) |
static void | AtEOSubXact_PgStat_DroppedStats (PgStat_SubXactStatus *xact_state, bool isCommit, int nestDepth) |
void | AtEOXact_PgStat (bool isCommit, bool parallel) |
void | AtEOSubXact_PgStat (bool isCommit, int nestDepth) |
void | AtPrepare_PgStat (void) |
void | PostPrepare_PgStat (void) |
PgStat_SubXactStatus * | pgstat_get_xact_stack_level (int nest_level) |
int | pgstat_get_transactional_drops (bool isCommit, xl_xact_stats_item **items) |
void | pgstat_execute_transactional_drops (int ndrops, struct xl_xact_stats_item *items, bool is_redo) |
static void | create_drop_transactional_internal (PgStat_Kind kind, Oid dboid, uint64 objid, bool is_create) |
void | pgstat_create_transactional (PgStat_Kind kind, Oid dboid, uint64 objid) |
void | pgstat_drop_transactional (PgStat_Kind kind, Oid dboid, uint64 objid) |
Variables | |
static PgStat_SubXactStatus * | pgStatXactStack = NULL |
typedef struct PgStat_PendingDroppedStatsItem PgStat_PendingDroppedStatsItem |
void AtEOSubXact_PgStat | ( | bool | isCommit, |
int | nestDepth | ||
) |
Definition at line 113 of file pgstat_xact.c.
References AtEOSubXact_PgStat_DroppedStats(), AtEOSubXact_PgStat_Relations(), PgStat_SubXactStatus::nest_level, pfree(), pgStatXactStack, and PgStat_SubXactStatus::prev.
Referenced by AbortSubTransaction(), and CommitSubTransaction().
|
static |
Definition at line 136 of file pgstat_xact.c.
References Assert, dlist_mutable_iter::cur, xl_xact_stats_item::dboid, dclist_container, dclist_count(), dclist_delete_from(), dclist_foreach_modify, dclist_push_tail(), PgStat_PendingDroppedStatsItem::is_create, PgStat_PendingDroppedStatsItem::item, xl_xact_stats_item::kind, PgStat_PendingDroppedStatsItem::node, xl_xact_stats_item::objid_hi, xl_xact_stats_item::objid_lo, PgStat_SubXactStatus::pending_drops, pfree(), pgstat_drop_entry(), pgstat_get_xact_stack_level(), and pgstat_request_entry_refs_gc().
Referenced by AtEOSubXact_PgStat().
void AtEOXact_PgStat | ( | bool | isCommit, |
bool | parallel | ||
) |
Definition at line 40 of file pgstat_xact.c.
References Assert, AtEOXact_PgStat_Database(), AtEOXact_PgStat_DroppedStats(), AtEOXact_PgStat_Relations(), PgStat_SubXactStatus::nest_level, pgstat_clear_snapshot(), pgStatXactStack, and PgStat_SubXactStatus::prev.
Referenced by AbortTransaction(), CommitTransaction(), and FinishPreparedTransaction().
|
static |
Definition at line 67 of file pgstat_xact.c.
References dlist_mutable_iter::cur, xl_xact_stats_item::dboid, dclist_container, dclist_count(), dclist_delete_from(), dclist_foreach_modify, PgStat_PendingDroppedStatsItem::is_create, PgStat_PendingDroppedStatsItem::item, xl_xact_stats_item::kind, PgStat_PendingDroppedStatsItem::node, xl_xact_stats_item::objid_hi, xl_xact_stats_item::objid_lo, PgStat_SubXactStatus::pending_drops, pfree(), pgstat_drop_entry(), and pgstat_request_entry_refs_gc().
Referenced by AtEOXact_PgStat().
void AtPrepare_PgStat | ( | void | ) |
Definition at line 191 of file pgstat_xact.c.
References Assert, AtPrepare_PgStat_Relations(), PgStat_SubXactStatus::nest_level, pgStatXactStack, and PgStat_SubXactStatus::prev.
Referenced by PrepareTransaction().
|
static |
Definition at line 335 of file pgstat_xact.c.
References xl_xact_stats_item::dboid, dclist_push_tail(), GetCurrentTransactionNestLevel(), PgStat_PendingDroppedStatsItem::is_create, PgStat_PendingDroppedStatsItem::item, xl_xact_stats_item::kind, MemoryContextAlloc(), PgStat_PendingDroppedStatsItem::node, xl_xact_stats_item::objid_hi, xl_xact_stats_item::objid_lo, PgStat_SubXactStatus::pending_drops, pgstat_get_xact_stack_level(), and TopTransactionContext.
Referenced by pgstat_create_transactional(), and pgstat_drop_transactional().
void pgstat_create_transactional | ( | PgStat_Kind | kind, |
Oid | dboid, | ||
uint64 | objid | ||
) |
Definition at line 361 of file pgstat_xact.c.
References create_drop_transactional_internal(), ereport, errmsg(), name, pgstat_get_entry_ref(), pgstat_get_kind_info(), pgstat_reset(), and WARNING.
Referenced by pgstat_create_function(), pgstat_create_relation(), and pgstat_create_subscription().
void pgstat_drop_transactional | ( | PgStat_Kind | kind, |
Oid | dboid, | ||
uint64 | objid | ||
) |
Definition at line 384 of file pgstat_xact.c.
References create_drop_transactional_internal().
Referenced by pgstat_drop_database(), pgstat_drop_function(), pgstat_drop_relation(), and pgstat_drop_subscription().
void pgstat_execute_transactional_drops | ( | int | ndrops, |
struct xl_xact_stats_item * | items, | ||
bool | is_redo | ||
) |
Definition at line 314 of file pgstat_xact.c.
References xl_xact_stats_item::dboid, i, items, xl_xact_stats_item::kind, xl_xact_stats_item::objid_hi, xl_xact_stats_item::objid_lo, pgstat_drop_entry(), and pgstat_request_entry_refs_gc().
Referenced by FinishPreparedTransaction(), xact_redo_abort(), and xact_redo_commit().
int pgstat_get_transactional_drops | ( | bool | isCommit, |
xl_xact_stats_item ** | items | ||
) |
Definition at line 272 of file pgstat_xact.c.
References Assert, dlist_iter::cur, dclist_container, dclist_count(), dclist_foreach, PgStat_PendingDroppedStatsItem::is_create, PgStat_PendingDroppedStatsItem::item, items, PgStat_SubXactStatus::nest_level, nitems, palloc(), PgStat_SubXactStatus::pending_drops, pgStatXactStack, and PgStat_SubXactStatus::prev.
Referenced by RecordTransactionAbort(), RecordTransactionCommit(), and StartPrepare().
PgStat_SubXactStatus* pgstat_get_xact_stack_level | ( | int | nest_level | ) |
Definition at line 238 of file pgstat_xact.c.
References dclist_init(), PgStat_SubXactStatus::first, MemoryContextAlloc(), PgStat_SubXactStatus::nest_level, PgStat_SubXactStatus::pending_drops, pgStatXactStack, PgStat_SubXactStatus::prev, and TopTransactionContext.
Referenced by add_tabstat_xact_level(), AtEOSubXact_PgStat_DroppedStats(), AtEOSubXact_PgStat_Relations(), and create_drop_transactional_internal().
void PostPrepare_PgStat | ( | void | ) |
Definition at line 211 of file pgstat_xact.c.
References Assert, PgStat_SubXactStatus::nest_level, pgstat_clear_snapshot(), pgStatXactStack, PostPrepare_PgStat_Relations(), and PgStat_SubXactStatus::prev.
Referenced by PrepareTransaction().
|
static |
Definition at line 33 of file pgstat_xact.c.
Referenced by AtEOSubXact_PgStat(), AtEOXact_PgStat(), AtPrepare_PgStat(), pgstat_get_transactional_drops(), pgstat_get_xact_stack_level(), and PostPrepare_PgStat().