↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Statistics & Metrics / pg_stat_xact_user_functions

pg_stat_xact_user_functions.calls

Source-defined field pg_stat_xact_user_functions.calls. The same-version manual describes this view but does not enumerate this column; the exact SQL expression is retained below.

Reading PostgreSQL 18.6.

Description

Source-defined field pg_stat_xact_user_functions.calls. The same-version manual describes this view but does not enumerate this column; the exact SQL expression is retained below.

View
pg_stat_xact_user_functions
Field
calls
Field evidence
Source declaration; not individually enumerated by the manual
Expression declared in
pg_stat_xact_user_functions

Usage

SELECT calls FROM pg_catalog.pg_stat_xact_user_functions;

View semantics

Similar to pg_stat_user_functions, but counts only calls during the current transaction (which are not yet included in pg_stat_user_functions).

Collection and transaction context

A transaction can also see its own statistics (not yet flushed out to the shared memory statistics) in the views pg_stat_xact_all_tables , pg_stat_xact_sys_tables , pg_stat_xact_user_tables , and pg_stat_xact_user_functions . These numbers do not act as stated above; instead they update continuously throughout the transaction.

Exact source expression

No per-field definition, effective SQL type, unit, or reset rule is inferred from this expression.

pg_stat_get_xact_function_calls(P.oid)

Complete source view definition

CREATE VIEW pg_stat_xact_user_functions AS
SELECT
            P.oid AS funcid,
            N.nspname AS schemaname,
            P.proname AS funcname,
            pg_stat_get_xact_function_calls(P.oid) AS calls,
            pg_stat_get_xact_function_total_time(P.oid) AS total_time,
            pg_stat_get_xact_function_self_time(P.oid) AS self_time
    FROM pg_proc P LEFT JOIN pg_namespace N ON (N.oid = P.pronamespace)
    WHERE P.prolang != 12  -- fast check to eliminate built-in functions
          AND pg_stat_get_xact_function_calls(P.oid) IS NOT NULL;

Related entries

Documentation and source

Source build
Version
18.6
Build
https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
Source fingerprint
555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f

Compare versions

PostgreSQL 17 → 18: unchanged.

Compares recorded interfaces and attributes. Source fingerprints and build metadata are excluded; an absent sample is not proof of the introduction or removal release.

Related entries

Export JSON · Back to Statistics & Metrics · Recorded in PostgreSQL 10 through 20; the first sample is not necessarily its introduction.