|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <math.h>#include <sys/stat.h>#include <unistd.h>#include "access/htup_details.h"#include "access/parallel.h"#include "catalog/pg_authid.h"#include "executor/instrument.h"#include "funcapi.h"#include "jit/jit.h"#include "mb/pg_wchar.h"#include "miscadmin.h"#include "nodes/queryjumble.h"#include "optimizer/planner.h"#include "parser/analyze.h"#include "pgstat.h"#include "storage/fd.h"#include "storage/ipc.h"#include "storage/lwlock.h"#include "storage/shmem.h"#include "storage/spin.h"#include "tcop/utility.h"#include "utils/acl.h"#include "utils/builtins.h"#include "utils/memutils.h"#include "utils/timestamp.h"#include "utils/tuplestore.h"
Go to the source code of this file.
Data Structures | |
| struct | pgssHashKey |
| struct | Counters |
| struct | pgssGlobalStats |
| struct | pgssEntry |
| struct | pgssSharedState |
Typedefs | |
| typedef enum pgssVersion | pgssVersion |
| typedef enum pgssStoreKind | pgssStoreKind |
| typedef struct pgssHashKey | pgssHashKey |
| typedef struct Counters | Counters |
| typedef struct pgssGlobalStats | pgssGlobalStats |
| typedef struct pgssEntry | pgssEntry |
| typedef struct pgssSharedState | pgssSharedState |
Enumerations | |
| enum | pgssVersion { PGSS_V1_0 = 0 , PGSS_V1_1 , PGSS_V1_2 , PGSS_V1_3 , PGSS_V1_8 , PGSS_V1_9 , PGSS_V1_10 , PGSS_V1_11 , PGSS_V1_12 , PGSS_V1_13 } |
| enum | pgssStoreKind { PGSS_INVALID = -1 , PGSS_PLAN = 0 , PGSS_EXEC } |
| enum | PGSSTrackLevel { PGSS_TRACK_NONE , PGSS_TRACK_TOP , PGSS_TRACK_ALL } |
Definition at line 97 of file pg_stat_statements.c.
Definition at line 96 of file pg_stat_statements.c.
Definition at line 101 of file pg_stat_statements.c.
Definition at line 1559 of file pg_stat_statements.c.
| #define PG_STAT_STATEMENTS_COLS_V1_0 14 |
Definition at line 1549 of file pg_stat_statements.c.
| #define PG_STAT_STATEMENTS_COLS_V1_1 18 |
Definition at line 1550 of file pg_stat_statements.c.
| #define PG_STAT_STATEMENTS_COLS_V1_10 43 |
Definition at line 1555 of file pg_stat_statements.c.
| #define PG_STAT_STATEMENTS_COLS_V1_11 49 |
Definition at line 1556 of file pg_stat_statements.c.
| #define PG_STAT_STATEMENTS_COLS_V1_12 52 |
Definition at line 1557 of file pg_stat_statements.c.
| #define PG_STAT_STATEMENTS_COLS_V1_13 54 |
Definition at line 1558 of file pg_stat_statements.c.
| #define PG_STAT_STATEMENTS_COLS_V1_2 19 |
Definition at line 1551 of file pg_stat_statements.c.
| #define PG_STAT_STATEMENTS_COLS_V1_3 23 |
Definition at line 1552 of file pg_stat_statements.c.
| #define PG_STAT_STATEMENTS_COLS_V1_8 32 |
Definition at line 1553 of file pg_stat_statements.c.
| #define PG_STAT_STATEMENTS_COLS_V1_9 33 |
Definition at line 1554 of file pg_stat_statements.c.
| #define PG_STAT_STATEMENTS_INFO_COLS 2 |
Definition at line 2029 of file pg_stat_statements.c.
| #define PGSS_DUMP_FILE PGSTAT_STAT_PERMANENT_DIRECTORY "/pg_stat_statements.stat" |
Definition at line 80 of file pg_stat_statements.c.
| #define pgss_enabled | ( | level | ) |
Definition at line 310 of file pg_stat_statements.c.
Definition at line 133 of file pg_stat_statements.c.
| #define PGSS_TEXT_FILE PG_STAT_TMP_DIR "/pgss_query_texts.stat" |
Definition at line 85 of file pg_stat_statements.c.
| #define record_gc_qtexts | ( | ) |
Definition at line 315 of file pg_stat_statements.c.
Definition at line 2654 of file pg_stat_statements.c.
Definition at line 99 of file pg_stat_statements.c.
Definition at line 100 of file pg_stat_statements.c.
| #define USAGE_DECREASE_FACTOR (0.99) /* decreased every entry_dealloc */ |
Definition at line 98 of file pg_stat_statements.c.
Definition at line 94 of file pg_stat_statements.c.
Definition at line 95 of file pg_stat_statements.c.
| typedef struct pgssHashKey pgssHashKey |
| Enumerator | |
|---|---|
| PGSS_INVALID | |
| PGSS_PLAN | |
| PGSS_EXEC | |
Definition at line 120 of file pg_stat_statements.c.
| Enumerator | |
|---|---|
| PGSS_TRACK_NONE | |
| PGSS_TRACK_TOP | |
| PGSS_TRACK_ALL | |
Definition at line 288 of file pg_stat_statements.c.
| Enumerator | |
|---|---|
| PGSS_V1_0 | |
| PGSS_V1_1 | |
| PGSS_V1_2 | |
| PGSS_V1_3 | |
| PGSS_V1_8 | |
| PGSS_V1_9 | |
| PGSS_V1_10 | |
| PGSS_V1_11 | |
| PGSS_V1_12 | |
| PGSS_V1_13 | |
Definition at line 106 of file pg_stat_statements.c.
Definition at line 390 of file pg_stat_statements.c.
References DefineCustomBoolVariable(), DefineCustomEnumVariable(), DefineCustomIntVariable(), EnableQueryId(), ExecutorEnd_hook, ExecutorFinish_hook, ExecutorRun_hook, ExecutorStart_hook, fb(), MarkGUCPrefixReserved(), PGC_POSTMASTER, PGC_SIGHUP, PGC_SUSET, pgss_ExecutorEnd(), pgss_ExecutorFinish(), pgss_ExecutorRun(), pgss_ExecutorStart(), pgss_max, pgss_planner(), pgss_post_parse_analyze(), pgss_ProcessUtility(), pgss_save, pgss_shmem_callbacks, pgss_track, pgss_track_planning, PGSS_TRACK_TOP, pgss_track_utility, planner_hook, post_parse_analyze_hook, prev_ExecutorEnd, prev_ExecutorFinish, prev_ExecutorRun, prev_ExecutorStart, prev_planner_hook, prev_post_parse_analyze_hook, prev_ProcessUtility, process_shared_preload_libraries_in_progress, ProcessUtility_hook, RegisterShmemCallbacks(), and track_options.
|
static |
Definition at line 2080 of file pg_stat_statements.c.
References Assert, pgssEntry::counters, pgssSharedState::cur_median_usage, pgssEntry::encoding, encoding, entry_dealloc(), fb(), GetCurrentTimestamp(), HASH_ENTER, hash_get_num_entries(), hash_search(), pgssEntry::minmax_stats_since, pgssEntry::mutex, pgss, pgss_hash, pgss_max, pgssEntry::query_len, pgssEntry::query_offset, SpinLockInit(), pgssEntry::stats_since, Counters::usage, and USAGE_INIT.
Referenced by pgss_shmem_init(), and pgss_store().
Definition at line 2119 of file pg_stat_statements.c.
References pgssEntry::counters, fb(), and Counters::usage.
Referenced by entry_dealloc().
Definition at line 2138 of file pg_stat_statements.c.
References ASSUMED_LENGTH_INIT, pgssEntry::counters, pgssSharedState::cur_median_usage, pgssGlobalStats::dealloc, entry_cmp(), fb(), hash_get_num_entries(), HASH_REMOVE, hash_search(), hash_seq_init(), hash_seq_search(), i, IS_STICKY, Max, pgssSharedState::mean_query_len, Min, pgssSharedState::mutex, palloc(), pfree(), pgss, pgss_hash, qsort, pgssEntry::query_len, SpinLockAcquire(), SpinLockRelease(), pgssSharedState::stats, STICKY_DECREASE_FACTOR, Counters::usage, USAGE_DEALLOC_PERCENT, and USAGE_DECREASE_FACTOR.
Referenced by entry_alloc().
Definition at line 2677 of file pg_stat_statements.c.
References AllocateFile(), pgssHashKey::dbid, pgssGlobalStats::dealloc, ereport, errcode(), errcode_for_file_access(), errmsg, ERROR, pgssSharedState::extent, fb(), FreeFile(), GetCurrentTimestamp(), HASH_FIND, hash_get_num_entries(), hash_search(), hash_seq_init(), hash_seq_search(), INT64CONST, pgssEntry::key, pgssSharedState::lock, LWLockPadded::lock, LOG, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), pgssSharedState::mutex, PG_BINARY_W, pgss, pgss_hash, PGSS_TEXT_FILE, pgssHashKey::queryid, record_gc_qtexts, SINGLE_ENTRY_RESET, SpinLockAcquire(), SpinLockRelease(), pgssSharedState::stats, pgssGlobalStats::stats_reset, and pgssHashKey::userid.
Referenced by pg_stat_statements_reset(), pg_stat_statements_reset_1_11(), and pg_stat_statements_reset_1_7().
Definition at line 2474 of file pg_stat_statements.c.
References AllocateFile(), ASSUMED_LENGTH_INIT, DEBUG1, elog, ereport, errcode_for_file_access(), errmsg, pgssSharedState::extent, fb(), FreeFile(), hash_seq_init(), hash_seq_search(), hash_seq_term(), LOG, pgssSharedState::mean_query_len, need_gc_qtexts(), pfree(), PG_BINARY_W, pgss, pgss_hash, PGSS_TEXT_FILE, qtext_fetch(), qtext_load_file(), pgssEntry::query_len, pgssEntry::query_offset, and record_gc_qtexts.
Referenced by pgss_store().
|
static |
Definition at line 2811 of file pg_stat_statements.c.
References Assert, ComputeConstantLengths(), fb(), i, memcpy(), palloc(), pfree(), and sprintf.
Referenced by pgss_store().
Definition at line 2425 of file pg_stat_statements.c.
References pgssSharedState::extent, pgssSharedState::mean_query_len, pgssSharedState::mutex, pgss, pgss_max, SpinLockAcquire(), and SpinLockRelease().
Referenced by gc_qtexts(), and pgss_store().
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_1_10 | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_1_11 | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_1_12 | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_1_13 | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_1_2 | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_1_3 | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_1_8 | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_1_9 | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_info | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_reset | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_reset_1_11 | ) |
| PG_FUNCTION_INFO_V1 | ( | pg_stat_statements_reset_1_7 | ) |
| PG_MODULE_MAGIC_EXT | ( | . | name = "pg_stat_statements", |
| . | version = PG_VERSION |
||
| ) |
| Datum pg_stat_statements | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1656 of file pg_stat_statements.c.
References pg_stat_statements_internal(), and PGSS_V1_0.
| Datum pg_stat_statements_1_10 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1602 of file pg_stat_statements.c.
References fb(), PG_GETARG_BOOL, pg_stat_statements_internal(), and PGSS_V1_10.
| Datum pg_stat_statements_1_11 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1592 of file pg_stat_statements.c.
References fb(), PG_GETARG_BOOL, pg_stat_statements_internal(), and PGSS_V1_11.
| Datum pg_stat_statements_1_12 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1582 of file pg_stat_statements.c.
References fb(), PG_GETARG_BOOL, pg_stat_statements_internal(), and PGSS_V1_12.
| Datum pg_stat_statements_1_13 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1572 of file pg_stat_statements.c.
References fb(), PG_GETARG_BOOL, pg_stat_statements_internal(), and PGSS_V1_13.
| Datum pg_stat_statements_1_2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1642 of file pg_stat_statements.c.
References fb(), PG_GETARG_BOOL, pg_stat_statements_internal(), and PGSS_V1_2.
| Datum pg_stat_statements_1_3 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1632 of file pg_stat_statements.c.
References fb(), PG_GETARG_BOOL, pg_stat_statements_internal(), and PGSS_V1_3.
| Datum pg_stat_statements_1_8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1622 of file pg_stat_statements.c.
References fb(), PG_GETARG_BOOL, pg_stat_statements_internal(), and PGSS_V1_8.
| Datum pg_stat_statements_1_9 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1612 of file pg_stat_statements.c.
References fb(), PG_GETARG_BOOL, pg_stat_statements_internal(), and PGSS_V1_9.
| Datum pg_stat_statements_info | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2035 of file pg_stat_statements.c.
References pgssGlobalStats::dealloc, elog, ereport, errcode(), errmsg, ERROR, fb(), get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), Int64GetDatum(), pgssSharedState::mutex, PG_RETURN_DATUM, PG_STAT_STATEMENTS_INFO_COLS, pgss, pgss_hash, SpinLockAcquire(), SpinLockRelease(), pgssSharedState::stats, pgssGlobalStats::stats_reset, TimestampTzGetDatum(), TYPEFUNC_COMPOSITE, and values.
|
static |
Definition at line 1666 of file pg_stat_statements.c.
References Assert, BoolGetDatum(), buf, Counters::calls, pgssEntry::counters, CStringGetDatum(), CStringGetTextDatum, Counters::custom_plan_calls, pgssHashKey::dbid, DirectFunctionCall3, elog, enc, pgssEntry::encoding, ereport, errcode(), errmsg, ERROR, pgssSharedState::extent, fb(), Float8GetDatumFast, pgssSharedState::gc_count, Counters::generic_plan_calls, GetUserId(), has_privs_of_role(), hash_seq_init(), hash_seq_search(), i, InitMaterializedSRF(), Int32GetDatum(), Int64GetDatumFast, IS_STICKY, Counters::jit_deform_count, Counters::jit_deform_time, Counters::jit_emission_count, Counters::jit_emission_time, Counters::jit_functions, Counters::jit_generation_time, Counters::jit_inlining_count, Counters::jit_inlining_time, Counters::jit_optimization_count, Counters::jit_optimization_time, pgssEntry::key, Counters::local_blk_read_time, Counters::local_blk_write_time, Counters::local_blks_dirtied, Counters::local_blks_hit, Counters::local_blks_read, Counters::local_blks_written, pgssSharedState::lock, LWLockPadded::lock, LW_SHARED, LWLockAcquire(), LWLockRelease(), Counters::max_time, Counters::mean_time, Counters::min_time, pgssEntry::minmax_stats_since, pgssEntry::mutex, pgssSharedState::mutex, pgssSharedState::n_writers, numeric_in(), ObjectIdGetDatum(), Counters::parallel_workers_launched, Counters::parallel_workers_to_launch, pfree(), pg_any_to_server(), PG_STAT_STATEMENTS_COLS, PG_STAT_STATEMENTS_COLS_V1_0, PG_STAT_STATEMENTS_COLS_V1_1, PG_STAT_STATEMENTS_COLS_V1_10, PG_STAT_STATEMENTS_COLS_V1_11, PG_STAT_STATEMENTS_COLS_V1_12, PG_STAT_STATEMENTS_COLS_V1_13, PG_STAT_STATEMENTS_COLS_V1_2, PG_STAT_STATEMENTS_COLS_V1_3, PG_STAT_STATEMENTS_COLS_V1_8, PG_STAT_STATEMENTS_COLS_V1_9, pgss, PGSS_EXEC, pgss_hash, PGSS_NUMKIND, PGSS_V1_0, PGSS_V1_1, PGSS_V1_10, PGSS_V1_11, PGSS_V1_12, PGSS_V1_13, PGSS_V1_2, PGSS_V1_3, PGSS_V1_8, PGSS_V1_9, qtext_fetch(), qtext_load_file(), pgssEntry::query_len, pgssEntry::query_offset, pgssHashKey::queryid, FunctionCallInfoBaseData::resultinfo, Counters::rows, Counters::shared_blk_read_time, Counters::shared_blk_write_time, Counters::shared_blks_dirtied, Counters::shared_blks_hit, Counters::shared_blks_read, Counters::shared_blks_written, snprintf, SpinLockAcquire(), SpinLockRelease(), pgssEntry::stats_since, Counters::sum_var_time, Counters::temp_blk_read_time, Counters::temp_blk_write_time, Counters::temp_blks_read, Counters::temp_blks_written, TimestampTzGetDatum(), pgssHashKey::toplevel, Counters::total_time, tuplestore_putvalues(), UINT64_FORMAT, pgssHashKey::userid, values, Counters::wal_buffers_full, Counters::wal_bytes, Counters::wal_fpi, and Counters::wal_records.
Referenced by pg_stat_statements(), pg_stat_statements_1_10(), pg_stat_statements_1_11(), pg_stat_statements_1_12(), pg_stat_statements_1_13(), pg_stat_statements_1_2(), pg_stat_statements_1_3(), pg_stat_statements_1_8(), and pg_stat_statements_1_9().
| Datum pg_stat_statements_reset | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1541 of file pg_stat_statements.c.
References entry_reset(), and PG_RETURN_VOID.
| Datum pg_stat_statements_reset_1_11 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1522 of file pg_stat_statements.c.
References entry_reset(), fb(), PG_GETARG_BOOL, PG_GETARG_INT64, PG_GETARG_OID, and PG_RETURN_TIMESTAMPTZ.
| Datum pg_stat_statements_reset_1_7 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1506 of file pg_stat_statements.c.
References entry_reset(), PG_GETARG_INT64, PG_GETARG_OID, and PG_RETURN_VOID.
Definition at line 1059 of file pg_stat_statements.c.
References Instrumentation::bufusage, EState::es_jit, EState::es_parallel_workers_launched, EState::es_parallel_workers_to_launch, EState::es_total_processed, QueryDesc::estate, fb(), JitContext::instr, INSTR_TIME_GET_MILLISEC, INT64CONST, nesting_level, pgss_enabled, PGSS_EXEC, pgss_store(), QueryDesc::plannedstmt, PlannedStmt::planOrigin, prev_ExecutorEnd, QueryDesc::query_instr, PlannedStmt::queryId, QueryDesc::sourceText, standard_ExecutorEnd(), PlannedStmt::stmt_len, PlannedStmt::stmt_location, Instrumentation::total, and Instrumentation::walusage.
Referenced by _PG_init().
Definition at line 1038 of file pg_stat_statements.c.
References nesting_level, PG_END_TRY, PG_FINALLY, PG_TRY, prev_ExecutorFinish, and standard_ExecutorFinish().
Referenced by _PG_init().
|
static |
Definition at line 1017 of file pg_stat_statements.c.
References nesting_level, PG_END_TRY, PG_FINALLY, PG_TRY, prev_ExecutorRun, and standard_ExecutorRun().
Referenced by _PG_init().
Definition at line 994 of file pg_stat_statements.c.
References INSTRUMENT_ALL, INT64CONST, nesting_level, pgss_enabled, QueryDesc::plannedstmt, prev_ExecutorStart, QueryDesc::query_instr_options, PlannedStmt::queryId, and standard_ExecutorStart().
Referenced by _PG_init().
|
static |
Definition at line 887 of file pg_stat_statements.c.
References BufferUsageAccumDiff(), duration, fb(), INSTR_TIME_GET_MILLISEC, INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, INT64CONST, nesting_level, parse(), PG_END_TRY, PG_FINALLY, PG_TRY, pgBufferUsage, pgss_enabled, PGSS_PLAN, pgss_store(), pgss_track_planning, pgWalUsage, prev_planner_hook, result, standard_planner(), start, and WalUsageAccumDiff().
Referenced by _PG_init().
|
static |
Definition at line 834 of file pg_stat_statements.c.
References fb(), INT64CONST, IsA, nesting_level, ParseState::p_sourcetext, pgss, pgss_enabled, pgss_hash, PGSS_INVALID, pgss_store(), pgss_track_utility, PLAN_STMT_UNKNOWN, prev_post_parse_analyze_hook, Query::stmt_location, and Query::utilityStmt.
Referenced by _PG_init().
|
static |
Definition at line 1092 of file pg_stat_statements.c.
References BufferUsageAccumDiff(), QueryCompletion::commandTag, duration, fb(), INSTR_TIME_GET_MILLISEC, INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, INT64CONST, IsA, nesting_level, QueryCompletion::nprocessed, PG_END_TRY, PG_FINALLY, PG_TRY, pgBufferUsage, pgss_enabled, PGSS_EXEC, pgss_store(), pgss_track_utility, pgWalUsage, PlannedStmt::planOrigin, prev_ProcessUtility, PlannedStmt::queryId, standard_ProcessUtility(), start, PlannedStmt::stmt_len, PlannedStmt::stmt_location, PlannedStmt::utilityStmt, and WalUsageAccumDiff().
Referenced by _PG_init().
Definition at line 530 of file pg_stat_statements.c.
References AllocateFile(), Assert, ASSUMED_LENGTH_INIT, ASSUMED_MEDIAN_INIT, pgssEntry::counters, pgssSharedState::cur_median_usage, pgssGlobalStats::dealloc, entry_alloc(), ereport, errcode(), errcode_for_file_access(), errmsg, pgssSharedState::extent, fb(), FreeFile(), pgssSharedState::gc_count, GetCurrentTimestamp(), i, IS_STICKY, IsUnderPostmaster, pgssSharedState::lock, LWLockPadded::lock, LOG, LWLockInitialize(), LWLockNewTrancheId(), Max, pgssSharedState::mean_query_len, pgssEntry::minmax_stats_since, pgssSharedState::mutex, pgssSharedState::n_writers, on_shmem_exit(), palloc(), pfree(), PG_BINARY_R, PG_BINARY_W, PG_VALID_BE_ENCODING, pgss, PGSS_DUMP_FILE, PGSS_FILE_HEADER, pgss_hash, PGSS_PG_MAJOR_VERSION, pgss_save, pgss_shmem_shutdown(), PGSS_TEXT_FILE, repalloc(), SpinLockInit(), pgssSharedState::stats, pgssGlobalStats::stats_reset, and pgssEntry::stats_since.
Definition at line 506 of file pg_stat_statements.c.
References HASH_BLOBS, HASH_ELEM, name, pgss, pgss_hash, pgss_max, ShmemRequestHash, and ShmemRequestStruct.
Definition at line 734 of file pg_stat_statements.c.
References AllocateFile(), durable_rename(), ereport, errcode_for_file_access(), errmsg, error(), fb(), FreeFile(), hash_get_num_entries(), hash_seq_init(), hash_seq_search(), hash_seq_term(), len, LOG, pfree(), PG_BINARY_W, pgss, PGSS_DUMP_FILE, PGSS_FILE_HEADER, pgss_hash, PGSS_PG_MAJOR_VERSION, pgss_save, PGSS_TEXT_FILE, qtext_fetch(), qtext_load_file(), pgssEntry::query_len, pgssEntry::query_offset, and pgssSharedState::stats.
Referenced by pgss_shmem_init().
|
static |
Definition at line 1267 of file pg_stat_statements.c.
References Assert, Counters::calls, CleanQuerytext(), pgssEntry::counters, Counters::custom_plan_calls, encoding, entry_alloc(), fb(), pgssSharedState::gc_count, gc_qtexts(), generate_normalized_query(), Counters::generic_plan_calls, GetDatabaseEncoding(), GetUserId(), HASH_FIND, hash_search(), INSTR_TIME_GET_MILLISEC, INT64CONST, IS_STICKY, Counters::jit_deform_count, Counters::jit_deform_time, Counters::jit_emission_count, Counters::jit_emission_time, Counters::jit_functions, Counters::jit_generation_time, Counters::jit_inlining_count, Counters::jit_inlining_time, Counters::jit_optimization_count, Counters::jit_optimization_time, Counters::local_blk_read_time, BufferUsage::local_blk_read_time, Counters::local_blk_write_time, BufferUsage::local_blk_write_time, Counters::local_blks_dirtied, BufferUsage::local_blks_dirtied, Counters::local_blks_hit, BufferUsage::local_blks_hit, Counters::local_blks_read, BufferUsage::local_blks_read, Counters::local_blks_written, BufferUsage::local_blks_written, pgssSharedState::lock, LWLockPadded::lock, LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), Counters::max_time, Counters::mean_time, Counters::min_time, pgssEntry::mutex, MyDatabaseId, need_gc_qtexts(), nesting_level, Counters::parallel_workers_launched, Counters::parallel_workers_to_launch, pfree(), pgss, PGSS_EXEC, pgss_hash, PGSS_PLAN, PLAN_STMT_CACHE_CUSTOM, PLAN_STMT_CACHE_GENERIC, qtext_store(), Counters::rows, Counters::shared_blk_read_time, BufferUsage::shared_blk_read_time, Counters::shared_blk_write_time, BufferUsage::shared_blk_write_time, Counters::shared_blks_dirtied, BufferUsage::shared_blks_dirtied, Counters::shared_blks_hit, BufferUsage::shared_blks_hit, Counters::shared_blks_read, BufferUsage::shared_blks_read, Counters::shared_blks_written, BufferUsage::shared_blks_written, SpinLockAcquire(), SpinLockRelease(), Counters::sum_var_time, Counters::temp_blk_read_time, BufferUsage::temp_blk_read_time, Counters::temp_blk_write_time, BufferUsage::temp_blk_write_time, Counters::temp_blks_read, BufferUsage::temp_blks_read, Counters::temp_blks_written, BufferUsage::temp_blks_written, Counters::total_time, Counters::usage, USAGE_EXEC, USAGE_INIT, Counters::wal_buffers_full, WalUsage::wal_buffers_full, Counters::wal_bytes, WalUsage::wal_bytes, Counters::wal_fpi, WalUsage::wal_fpi, Counters::wal_records, and WalUsage::wal_records.
Referenced by pgss_ExecutorEnd(), pgss_planner(), pgss_post_parse_analyze(), and pgss_ProcessUtility().
|
static |
Definition at line 2402 of file pg_stat_statements.c.
References fb().
Referenced by gc_qtexts(), pg_stat_statements_internal(), and pgss_shmem_shutdown().
Definition at line 2309 of file pg_stat_statements.c.
References buf, CloseTransientFile(), ereport, errcode(), errcode_for_file_access(), errdetail(), errmsg, fb(), fd(), fstat, LOG, MaxAllocHugeSize, MCXT_ALLOC_HUGE, MCXT_ALLOC_NO_OOM, Min, OpenTransientFile(), palloc_extended(), pfree(), PG_BINARY, PGSS_TEXT_FILE, read, and stat::st_size.
Referenced by gc_qtexts(), pg_stat_statements_internal(), and pgss_shmem_shutdown().
|
static |
Definition at line 2229 of file pg_stat_statements.c.
References CloseTransientFile(), ereport, errcode_for_file_access(), errmsg, error(), pgssSharedState::extent, fb(), fd(), pgssSharedState::gc_count, LOG, MaxAllocHugeSize, pgssSharedState::mutex, pgssSharedState::n_writers, OpenTransientFile(), PG_BINARY, pg_pwrite, pgss, PGSS_TEXT_FILE, SpinLockAcquire(), SpinLockRelease(), and unlikely.
Referenced by pgss_store().
|
static |
Definition at line 275 of file pg_stat_statements.c.
Referenced by pgss_ExecutorEnd(), pgss_ExecutorFinish(), pgss_ExecutorRun(), pgss_ExecutorStart(), pgss_planner(), pgss_post_parse_analyze(), pgss_ProcessUtility(), and pgss_store().
|
static |
Definition at line 261 of file pg_stat_statements.c.
Referenced by entry_alloc(), entry_dealloc(), entry_reset(), gc_qtexts(), need_gc_qtexts(), pg_stat_statements_info(), pg_stat_statements_internal(), pgss_post_parse_analyze(), pgss_shmem_init(), pgss_shmem_request(), pgss_shmem_shutdown(), pgss_store(), and qtext_store().
Definition at line 88 of file pg_stat_statements.c.
Referenced by pgss_shmem_init(), and pgss_shmem_shutdown().
|
static |
Definition at line 262 of file pg_stat_statements.c.
Referenced by entry_alloc(), entry_dealloc(), entry_reset(), gc_qtexts(), pg_stat_statements_info(), pg_stat_statements_internal(), pgss_post_parse_analyze(), pgss_shmem_init(), pgss_shmem_request(), pgss_shmem_shutdown(), and pgss_store().
|
static |
Definition at line 303 of file pg_stat_statements.c.
Referenced by _PG_init(), entry_alloc(), need_gc_qtexts(), and pgss_shmem_request().
|
static |
Definition at line 91 of file pg_stat_statements.c.
Referenced by pgss_shmem_init(), and pgss_shmem_shutdown().
Definition at line 308 of file pg_stat_statements.c.
Referenced by _PG_init(), pgss_shmem_init(), and pgss_shmem_shutdown().
|
static |
Definition at line 267 of file pg_stat_statements.c.
Referenced by _PG_init().
|
static |
Definition at line 304 of file pg_stat_statements.c.
Referenced by _PG_init().
Definition at line 306 of file pg_stat_statements.c.
Referenced by _PG_init(), and pgss_planner().
Definition at line 305 of file pg_stat_statements.c.
Referenced by _PG_init(), pgss_post_parse_analyze(), and pgss_ProcessUtility().
|
static |
Definition at line 283 of file pg_stat_statements.c.
Referenced by _PG_init(), and pgss_ExecutorEnd().
|
static |
Definition at line 282 of file pg_stat_statements.c.
Referenced by _PG_init(), and pgss_ExecutorFinish().
|
static |
Definition at line 281 of file pg_stat_statements.c.
Referenced by _PG_init(), and pgss_ExecutorRun().
|
static |
Definition at line 280 of file pg_stat_statements.c.
Referenced by _PG_init(), and pgss_ExecutorStart().
|
static |
Definition at line 279 of file pg_stat_statements.c.
Referenced by _PG_init(), and pgss_planner().
|
static |
Definition at line 278 of file pg_stat_statements.c.
Referenced by _PG_init(), and pgss_post_parse_analyze().
|
static |
Definition at line 284 of file pg_stat_statements.c.
Referenced by _PG_init(), and pgss_ProcessUtility().
|
static |
Definition at line 295 of file pg_stat_statements.c.
Referenced by _PG_init().