@ -187,6 +187,7 @@ typedef struct Counters
int64 wal_records ; /* # of WAL records generated */
int64 wal_records ; /* # of WAL records generated */
int64 wal_fpi ; /* # of WAL full page images generated */
int64 wal_fpi ; /* # of WAL full page images generated */
uint64 wal_bytes ; /* total amount of WAL generated in bytes */
uint64 wal_bytes ; /* total amount of WAL generated in bytes */
int64 wal_buffers_full ; /* # of times the WAL buffers became full */
int64 jit_functions ; /* total number of JIT functions emitted */
int64 jit_functions ; /* total number of JIT functions emitted */
double jit_generation_time ; /* total time to generate jit code */
double jit_generation_time ; /* total time to generate jit code */
int64 jit_inlining_count ; /* number of times inlining time has been
int64 jit_inlining_count ; /* number of times inlining time has been
@ -1465,6 +1466,7 @@ pgss_store(const char *query, uint64 queryId,
entry - > counters . wal_records + = walusage - > wal_records ;
entry - > counters . wal_records + = walusage - > wal_records ;
entry - > counters . wal_fpi + = walusage - > wal_fpi ;
entry - > counters . wal_fpi + = walusage - > wal_fpi ;
entry - > counters . wal_bytes + = walusage - > wal_bytes ;
entry - > counters . wal_bytes + = walusage - > wal_bytes ;
entry - > counters . wal_buffers_full + = walusage - > wal_buffers_full ;
if ( jitusage )
if ( jitusage )
{
{
entry - > counters . jit_functions + = jitusage - > created_functions ;
entry - > counters . jit_functions + = jitusage - > created_functions ;
@ -1557,8 +1559,8 @@ pg_stat_statements_reset(PG_FUNCTION_ARGS)
# define PG_STAT_STATEMENTS_COLS_V1_9 33
# define PG_STAT_STATEMENTS_COLS_V1_9 33
# define PG_STAT_STATEMENTS_COLS_V1_10 43
# define PG_STAT_STATEMENTS_COLS_V1_10 43
# define PG_STAT_STATEMENTS_COLS_V1_11 49
# define PG_STAT_STATEMENTS_COLS_V1_11 49
# define PG_STAT_STATEMENTS_COLS_V1_12 51
# define PG_STAT_STATEMENTS_COLS_V1_12 52
# define PG_STAT_STATEMENTS_COLS 51 /* maximum of above */
# define PG_STAT_STATEMENTS_COLS 52 /* maximum of above */
/*
/*
* Retrieve statement statistics .
* Retrieve statement statistics .
@ -1955,6 +1957,10 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
Int32GetDatum ( - 1 ) ) ;
Int32GetDatum ( - 1 ) ) ;
values [ i + + ] = wal_bytes ;
values [ i + + ] = wal_bytes ;
}
}
if ( api_version > = PGSS_V1_12 )
{
values [ i + + ] = Int64GetDatumFast ( tmp . wal_buffers_full ) ;
}
if ( api_version > = PGSS_V1_10 )
if ( api_version > = PGSS_V1_10 )
{
{
values [ i + + ] = Int64GetDatumFast ( tmp . jit_functions ) ;
values [ i + + ] = Int64GetDatumFast ( tmp . jit_functions ) ;