|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/twophase_rmgr.h"#include "access/xact.h"#include "catalog/catalog.h"#include "utils/memutils.h"#include "utils/pgstat_internal.h"#include "utils/rel.h"#include "utils/timestamp.h"
Go to the source code of this file.
Data Structures | |
| struct | TwoPhasePgStatRecord |
Typedefs | |
| typedef struct TwoPhasePgStatRecord | TwoPhasePgStatRecord |
|
static |
Definition at line 942 of file pgstat_relation.c.
References PgStat_SubXactStatus::first, MemoryContextAllocZero(), PgStat_TableXactStatus::parent, pgstat_get_xact_stack_level(), TopTransactionContext, PgStat_TableStatus::trans, and trans.
Referenced by ensure_tabstat_xact_level().
| void AtEOSubXact_PgStat_Relations | ( | PgStat_SubXactStatus * | xact_state, |
| bool | isCommit, | ||
| int | nestDepth | ||
| ) |
Definition at line 608 of file pgstat_relation.c.
References Assert, fb(), PgStat_SubXactStatus::first, pfree(), pgstat_get_xact_stack_level(), restore_truncdrop_counters(), save_truncdrop_counters(), and trans.
Referenced by AtEOSubXact_PgStat().
| void AtEOXact_PgStat_Relations | ( | PgStat_SubXactStatus * | xact_state, |
| bool | isCommit | ||
| ) |
Definition at line 550 of file pgstat_relation.c.
References Assert, fb(), PgStat_SubXactStatus::first, restore_truncdrop_counters(), and trans.
Referenced by AtEOXact_PgStat().
| void AtPrepare_PgStat_Relations | ( | PgStat_SubXactStatus * | xact_state | ) |
Definition at line 689 of file pgstat_relation.c.
References Assert, TwoPhasePgStatRecord::deleted_pre_truncdrop, fb(), PgStat_SubXactStatus::first, TwoPhasePgStatRecord::id, TwoPhasePgStatRecord::inserted_pre_truncdrop, PG_USED_FOR_ASSERTS_ONLY, RegisterTwoPhaseRecord(), TwoPhasePgStatRecord::shared, trans, TwoPhasePgStatRecord::truncdropped, TwoPhasePgStatRecord::tuples_deleted, TwoPhasePgStatRecord::tuples_inserted, TwoPhasePgStatRecord::tuples_updated, TWOPHASE_RM_PGSTAT_ID, and TwoPhasePgStatRecord::updated_pre_truncdrop.
Referenced by AtPrepare_PgStat().
|
static |
Definition at line 969 of file pgstat_relation.c.
References add_tabstat_xact_level(), fb(), GetCurrentTransactionNestLevel(), PgStat_TableXactStatus::nest_level, and PgStat_TableStatus::trans.
Referenced by pgstat_count_heap_delete(), pgstat_count_heap_insert(), pgstat_count_heap_update(), and pgstat_count_truncate().
| PgStat_TableStatus * find_tabstat_entry | ( | Oid | rel_id | ) |
Definition at line 500 of file pgstat_relation.c.
References fb(), InvalidOid, MyDatabaseId, palloc_object, PgStat_EntryRef::pending, pgstat_fetch_pending_entry(), PGSTAT_KIND_RELATION, and trans.
Definition at line 131 of file pgstat_relation.c.
References Assert, fb(), RelationData::pgstat_enabled, RelationData::pgstat_info, pgstat_prep_relation_pending(), RelationData::rd_rel, PgStat_TableStatus::relation, and RelationGetRelid.
Definition at line 57 of file pgstat_relation.c.
References fb(), InvalidOid, MyDatabaseId, pgstat_fetch_stat_tabentry_ext(), pgstat_get_entry_ref_locked(), PGSTAT_KIND_RELATION, pgstat_unlock_entry(), RelationData::rd_rel, RelationGetRelid, and PgStat_EntryRef::shared_stats.
Referenced by index_concurrently_swap().
Definition at line 414 of file pgstat_relation.c.
References ensure_tabstat_xact_level(), RelationData::pgstat_info, pgstat_should_count_relation, PgStat_TableStatus::trans, and PgStat_TableXactStatus::tuples_deleted.
Referenced by heap_abort_speculative(), and heap_delete().
| void pgstat_count_heap_insert | ( | Relation | rel, |
| PgStat_Counter | n | ||
| ) |
Definition at line 373 of file pgstat_relation.c.
References ensure_tabstat_xact_level(), RelationData::pgstat_info, pgstat_should_count_relation, PgStat_TableStatus::trans, and PgStat_TableXactStatus::tuples_inserted.
Referenced by heap_insert(), heap_multi_insert(), and RefreshMatViewByOid().
Definition at line 388 of file pgstat_relation.c.
References Assert, PgStat_TableStatus::counts, ensure_tabstat_xact_level(), fb(), RelationData::pgstat_info, pgstat_should_count_relation, PgStat_TableStatus::trans, PgStat_TableCounts::tuples_hot_updated, PgStat_TableCounts::tuples_newpage_updated, and PgStat_TableXactStatus::tuples_updated.
Referenced by heap_update().
Definition at line 429 of file pgstat_relation.c.
References ensure_tabstat_xact_level(), RelationData::pgstat_info, pgstat_should_count_relation, save_truncdrop_counters(), PgStat_TableStatus::trans, PgStat_TableXactStatus::tuples_deleted, PgStat_TableXactStatus::tuples_inserted, and PgStat_TableXactStatus::tuples_updated.
Referenced by ExecuteTruncateGuts(), and RefreshMatViewByOid().
Definition at line 168 of file pgstat_relation.c.
References InvalidOid, MyDatabaseId, pgstat_create_transactional(), PGSTAT_KIND_RELATION, RelationData::rd_rel, and RelationGetRelid.
Referenced by heap_create().
Definition at line 179 of file pgstat_relation.c.
References GetCurrentTransactionNestLevel(), InvalidOid, MyDatabaseId, PgStat_TableXactStatus::nest_level, pgstat_drop_transactional(), RelationData::pgstat_info, PGSTAT_KIND_RELATION, pgstat_should_count_relation, RelationData::rd_rel, RelationGetRelid, save_truncdrop_counters(), PgStat_TableStatus::trans, PgStat_TableXactStatus::tuples_deleted, PgStat_TableXactStatus::tuples_inserted, and PgStat_TableXactStatus::tuples_updated.
Referenced by heap_drop_with_catalog(), and index_drop().
| PgStat_StatTabEntry * pgstat_fetch_stat_tabentry | ( | Oid | relid | ) |
Definition at line 469 of file pgstat_relation.c.
References IsSharedRelation(), and pgstat_fetch_stat_tabentry_ext().
| PgStat_StatTabEntry * pgstat_fetch_stat_tabentry_ext | ( | bool | shared, |
| Oid | reloid | ||
| ) |
Definition at line 479 of file pgstat_relation.c.
References InvalidOid, MyDatabaseId, pgstat_fetch_entry(), and PGSTAT_KIND_RELATION.
Referenced by do_autovacuum(), pgstat_copy_relation_stats(), pgstat_fetch_stat_tabentry(), and recheck_relation_needs_vacanalyze().
Definition at line 91 of file pgstat_relation.c.
References fb(), RelationData::pgstat_enabled, RelationData::pgstat_info, pgstat_track_counts, pgstat_unlink_relation(), and RelationData::rd_rel.
Referenced by relation_open(), and try_relation_open().
|
static |
Definition at line 923 of file pgstat_relation.c.
References fb(), PgStat_TableStatus::id, InvalidOid, MyDatabaseId, PgStat_EntryRef::pending, PGSTAT_KIND_RELATION, pgstat_prep_pending_entry(), and PgStat_TableStatus::shared.
Referenced by pgstat_assoc_relation(), pgstat_twophase_postabort(), and pgstat_twophase_postcommit().
| void pgstat_relation_delete_pending_cb | ( | PgStat_EntryRef * | entry_ref | ) |
Definition at line 904 of file pgstat_relation.c.
References PgStat_EntryRef::pending, pgstat_unlink_relation(), and PgStat_TableStatus::relation.
| bool pgstat_relation_flush_cb | ( | PgStat_EntryRef * | entry_ref, |
| bool | nowait | ||
| ) |
Definition at line 815 of file pgstat_relation.c.
References PgStat_HashKey::dboid, fb(), GetCurrentTransactionStopTimestamp(), PgStatShared_HashEntry::key, Max, PgStat_EntryRef::pending, pg_memory_is_all_zeros(), pgstat_lock_entry(), pgstat_prep_database_pending(), pgstat_unlock_entry(), PgStat_EntryRef::shared_entry, and PgStat_EntryRef::shared_stats.
| void pgstat_relation_reset_timestamp_cb | ( | PgStatShared_Common * | header, |
| TimestampTz | ts | ||
| ) |
Definition at line 913 of file pgstat_relation.c.
| void pgstat_report_analyze | ( | Relation | rel, |
| PgStat_Counter | livetuples, | ||
| PgStat_Counter | deadtuples, | ||
| bool | resetcounter, | ||
| TimestampTz | starttime | ||
| ) |
Definition at line 281 of file pgstat_relation.c.
References AmAutoVacuumWorkerProcess, Assert, PgStat_TableStatus::counts, PgStat_TableCounts::delta_dead_tuples, fb(), GetCurrentTimestamp(), InvalidOid, Max, MyDatabaseId, PGSTAT_BACKEND_FLUSH_IO, pgstat_flush_backend(), pgstat_flush_io(), pgstat_get_entry_ref_locked(), RelationData::pgstat_info, PGSTAT_KIND_RELATION, pgstat_should_count_relation, pgstat_track_counts, pgstat_unlock_entry(), RelationData::rd_rel, RelationGetRelid, PgStat_EntryRef::shared_stats, TimestampDifferenceMilliseconds(), PgStat_TableStatus::trans, trans, and PgStat_TableXactStatus::tuples_inserted.
Referenced by do_analyze_rel().
| void pgstat_report_vacuum | ( | Relation | rel, |
| PgStat_Counter | livetuples, | ||
| PgStat_Counter | deadtuples, | ||
| TimestampTz | starttime | ||
| ) |
Definition at line 210 of file pgstat_relation.c.
References AmAutoVacuumWorkerProcess, fb(), GetCurrentTimestamp(), InvalidOid, MyDatabaseId, PGSTAT_BACKEND_FLUSH_IO, pgstat_flush_backend(), pgstat_flush_io(), pgstat_get_entry_ref_locked(), PGSTAT_KIND_RELATION, pgstat_track_counts, pgstat_unlock_entry(), RelationData::rd_rel, RelationGetRelid, PgStat_EntryRef::shared_stats, and TimestampDifferenceMilliseconds().
Referenced by heap_vacuum_rel().
| void pgstat_twophase_postabort | ( | FullTransactionId | fxid, |
| uint16 | info, | ||
| void * | recdata, | ||
| uint32 | len | ||
| ) |
Definition at line 782 of file pgstat_relation.c.
References PgStat_TableStatus::counts, TwoPhasePgStatRecord::deleted_pre_truncdrop, PgStat_TableCounts::delta_dead_tuples, fb(), TwoPhasePgStatRecord::id, TwoPhasePgStatRecord::inserted_pre_truncdrop, pgstat_prep_relation_pending(), TwoPhasePgStatRecord::shared, TwoPhasePgStatRecord::truncdropped, TwoPhasePgStatRecord::tuples_deleted, PgStat_TableCounts::tuples_deleted, TwoPhasePgStatRecord::tuples_inserted, PgStat_TableCounts::tuples_inserted, TwoPhasePgStatRecord::tuples_updated, PgStat_TableCounts::tuples_updated, and TwoPhasePgStatRecord::updated_pre_truncdrop.
| void pgstat_twophase_postcommit | ( | FullTransactionId | fxid, |
| uint16 | info, | ||
| void * | recdata, | ||
| uint32 | len | ||
| ) |
Definition at line 746 of file pgstat_relation.c.
References PgStat_TableCounts::changed_tuples, PgStat_TableStatus::counts, PgStat_TableCounts::delta_dead_tuples, PgStat_TableCounts::delta_live_tuples, fb(), TwoPhasePgStatRecord::id, pgstat_prep_relation_pending(), TwoPhasePgStatRecord::shared, TwoPhasePgStatRecord::truncdropped, PgStat_TableCounts::truncdropped, TwoPhasePgStatRecord::tuples_deleted, PgStat_TableCounts::tuples_deleted, TwoPhasePgStatRecord::tuples_inserted, PgStat_TableCounts::tuples_inserted, TwoPhasePgStatRecord::tuples_updated, and PgStat_TableCounts::tuples_updated.
Definition at line 152 of file pgstat_relation.c.
References Assert, fb(), RelationData::pgstat_info, and PgStat_TableStatus::relation.
Referenced by pgstat_init_relation(), pgstat_relation_delete_pending_cb(), and RelationDestroyRelation().
Definition at line 452 of file pgstat_relation.c.
References PgStat_TableStatus::counts, PgStat_TableCounts::delta_dead_tuples, RelationData::pgstat_info, and pgstat_should_count_relation.
Referenced by heap_page_prune_opt().
| void PostPrepare_PgStat_Relations | ( | PgStat_SubXactStatus * | xact_state | ) |
Definition at line 727 of file pgstat_relation.c.
References fb(), PgStat_SubXactStatus::first, PgStat_TableStatus::trans, and trans.
Referenced by PostPrepare_PgStat().
|
static |
Definition at line 1003 of file pgstat_relation.c.
References trans.
Referenced by AtEOSubXact_PgStat_Relations(), and AtEOXact_PgStat_Relations().
|
static |
Definition at line 988 of file pgstat_relation.c.
Referenced by AtEOSubXact_PgStat_Relations(), pgstat_count_truncate(), and pgstat_drop_relation().