PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/transam.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, Oid objoid, bool is_create) |
void | pgstat_create_transactional (PgStat_Kind kind, Oid dboid, Oid objoid) |
void | pgstat_drop_transactional (PgStat_Kind kind, Oid dboid, Oid objoid) |
Variables | |
static PgStat_SubXactStatus * | pgStatXactStack = NULL |
typedef struct PgStat_PendingDroppedStatsItem PgStat_PendingDroppedStatsItem |
void AtEOSubXact_PgStat | ( | bool | isCommit, |
int | nestDepth | ||
) |
Definition at line 117 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 140 of file pgstat_xact.c.
References Assert(), dlist_mutable_iter::cur, xl_xact_stats_item::dboid, dlist_container, dlist_delete(), dlist_foreach_modify, dlist_push_tail(), PgStat_PendingDroppedStatsItem::is_create, PgStat_PendingDroppedStatsItem::item, xl_xact_stats_item::kind, PgStat_PendingDroppedStatsItem::node, xl_xact_stats_item::objoid, PgStat_SubXactStatus::pending_drops, PgStat_SubXactStatus::pending_drops_count, pfree(), pgstat_drop_entry(), pgstat_get_xact_stack_level(), and pgstat_request_entry_refs_gc().
Referenced by AtEOSubXact_PgStat().
Definition at line 41 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 68 of file pgstat_xact.c.
References Assert(), dlist_mutable_iter::cur, xl_xact_stats_item::dboid, dlist_container, dlist_delete(), dlist_foreach_modify, dlist_is_empty(), PgStat_PendingDroppedStatsItem::is_create, PgStat_PendingDroppedStatsItem::item, xl_xact_stats_item::kind, PgStat_PendingDroppedStatsItem::node, xl_xact_stats_item::objoid, PgStat_SubXactStatus::pending_drops, PgStat_SubXactStatus::pending_drops_count, pfree(), pgstat_drop_entry(), and pgstat_request_entry_refs_gc().
Referenced by AtEOXact_PgStat().
void AtPrepare_PgStat | ( | void | ) |
Definition at line 196 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 340 of file pgstat_xact.c.
References xl_xact_stats_item::dboid, dlist_push_tail(), GetCurrentTransactionNestLevel(), PgStat_PendingDroppedStatsItem::is_create, PgStat_PendingDroppedStatsItem::item, xl_xact_stats_item::kind, MemoryContextAlloc(), PgStat_PendingDroppedStatsItem::node, xl_xact_stats_item::objoid, PgStat_SubXactStatus::pending_drops, PgStat_SubXactStatus::pending_drops_count, 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, | ||
Oid | objoid | ||
) |
Definition at line 366 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, | ||
Oid | objoid | ||
) |
Definition at line 388 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 320 of file pgstat_xact.c.
References xl_xact_stats_item::dboid, i, xl_xact_stats_item::kind, xl_xact_stats_item::objoid, 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 278 of file pgstat_xact.c.
References Assert(), dlist_iter::cur, dlist_container, dlist_foreach, PgStat_PendingDroppedStatsItem::is_create, PgStat_PendingDroppedStatsItem::item, PgStat_SubXactStatus::nest_level, palloc(), PgStat_SubXactStatus::pending_drops, PgStat_SubXactStatus::pending_drops_count, pgStatXactStack, and PgStat_SubXactStatus::prev.
Referenced by RecordTransactionAbort(), RecordTransactionCommit(), and StartPrepare().
PgStat_SubXactStatus* pgstat_get_xact_stack_level | ( | int | nest_level | ) |
Definition at line 243 of file pgstat_xact.c.
References dlist_init(), PgStat_SubXactStatus::first, MemoryContextAlloc(), PgStat_SubXactStatus::nest_level, PgStat_SubXactStatus::pending_drops, PgStat_SubXactStatus::pending_drops_count, 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 216 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 34 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().