@@ -117,7 +117,8 @@ typedef enum pgssVersion
117
117
PGSS_V1_3 ,
118
118
PGSS_V1_8 ,
119
119
PGSS_V1_9 ,
120
- PGSS_V1_10
120
+ PGSS_V1_10 ,
121
+ PGSS_V1_11
121
122
} pgssVersion ;
122
123
123
124
typedef enum pgssStoreKind
@@ -192,6 +193,10 @@ typedef struct Counters
192
193
double jit_generation_time ; /* total time to generate jit code */
193
194
int64 jit_inlining_count ; /* number of times inlining time has been
194
195
* > 0 */
196
+ double jit_deform_time ; /* total time to deform tuples in jit code */
197
+ int64 jit_deform_count ; /* number of times deform time has been >
198
+ * 0 */
199
+
195
200
double jit_inlining_time ; /* total time to inline jit code */
196
201
int64 jit_optimization_count ; /* number of times optimization time
197
202
* has been > 0 */
@@ -312,6 +317,7 @@ PG_FUNCTION_INFO_V1(pg_stat_statements_1_3);
312
317
PG_FUNCTION_INFO_V1 (pg_stat_statements_1_8 );
313
318
PG_FUNCTION_INFO_V1 (pg_stat_statements_1_9 );
314
319
PG_FUNCTION_INFO_V1 (pg_stat_statements_1_10 );
320
+ PG_FUNCTION_INFO_V1 (pg_stat_statements_1_11 );
315
321
PG_FUNCTION_INFO_V1 (pg_stat_statements );
316
322
PG_FUNCTION_INFO_V1 (pg_stat_statements_info );
317
323
@@ -1398,6 +1404,10 @@ pgss_store(const char *query, uint64 queryId,
1398
1404
e -> counters .jit_functions += jitusage -> created_functions ;
1399
1405
e -> counters .jit_generation_time += INSTR_TIME_GET_MILLISEC (jitusage -> generation_counter );
1400
1406
1407
+ if (INSTR_TIME_GET_MILLISEC (jitusage -> deform_counter ))
1408
+ e -> counters .jit_deform_count ++ ;
1409
+ e -> counters .jit_deform_time += INSTR_TIME_GET_MILLISEC (jitusage -> deform_counter );
1410
+
1401
1411
if (INSTR_TIME_GET_MILLISEC (jitusage -> inlining_counter ))
1402
1412
e -> counters .jit_inlining_count ++ ;
1403
1413
e -> counters .jit_inlining_time += INSTR_TIME_GET_MILLISEC (jitusage -> inlining_counter );
@@ -1460,7 +1470,8 @@ pg_stat_statements_reset(PG_FUNCTION_ARGS)
1460
1470
#define PG_STAT_STATEMENTS_COLS_V1_8 32
1461
1471
#define PG_STAT_STATEMENTS_COLS_V1_9 33
1462
1472
#define PG_STAT_STATEMENTS_COLS_V1_10 43
1463
- #define PG_STAT_STATEMENTS_COLS 43 /* maximum of above */
1473
+ #define PG_STAT_STATEMENTS_COLS_V1_11 45
1474
+ #define PG_STAT_STATEMENTS_COLS 45 /* maximum of above */
1464
1475
1465
1476
/*
1466
1477
* Retrieve statement statistics.
@@ -1472,6 +1483,16 @@ pg_stat_statements_reset(PG_FUNCTION_ARGS)
1472
1483
* expected API version is identified by embedding it in the C name of the
1473
1484
* function. Unfortunately we weren't bright enough to do that for 1.1.
1474
1485
*/
1486
+ Datum
1487
+ pg_stat_statements_1_11 (PG_FUNCTION_ARGS )
1488
+ {
1489
+ bool showtext = PG_GETARG_BOOL (0 );
1490
+
1491
+ pg_stat_statements_internal (fcinfo , PGSS_V1_11 , showtext );
1492
+
1493
+ return (Datum ) 0 ;
1494
+ }
1495
+
1475
1496
Datum
1476
1497
pg_stat_statements_1_10 (PG_FUNCTION_ARGS )
1477
1498
{
@@ -1602,6 +1623,10 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
1602
1623
if (api_version != PGSS_V1_10 )
1603
1624
elog (ERROR , "incorrect number of output arguments" );
1604
1625
break ;
1626
+ case PG_STAT_STATEMENTS_COLS_V1_11 :
1627
+ if (api_version != PGSS_V1_11 )
1628
+ elog (ERROR , "incorrect number of output arguments" );
1629
+ break ;
1605
1630
default :
1606
1631
elog (ERROR , "incorrect number of output arguments" );
1607
1632
}
@@ -1834,6 +1859,11 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
1834
1859
values [i ++ ] = Int64GetDatumFast (tmp .jit_emission_count );
1835
1860
values [i ++ ] = Float8GetDatumFast (tmp .jit_emission_time );
1836
1861
}
1862
+ if (api_version >= PGSS_V1_11 )
1863
+ {
1864
+ values [i ++ ] = Int64GetDatumFast (tmp .jit_deform_count );
1865
+ values [i ++ ] = Float8GetDatumFast (tmp .jit_deform_time );
1866
+ }
1837
1867
1838
1868
Assert (i == (api_version == PGSS_V1_0 ? PG_STAT_STATEMENTS_COLS_V1_0 :
1839
1869
api_version == PGSS_V1_1 ? PG_STAT_STATEMENTS_COLS_V1_1 :
@@ -1842,6 +1872,7 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
1842
1872
api_version == PGSS_V1_8 ? PG_STAT_STATEMENTS_COLS_V1_8 :
1843
1873
api_version == PGSS_V1_9 ? PG_STAT_STATEMENTS_COLS_V1_9 :
1844
1874
api_version == PGSS_V1_10 ? PG_STAT_STATEMENTS_COLS_V1_10 :
1875
+ api_version == PGSS_V1_11 ? PG_STAT_STATEMENTS_COLS_V1_11 :
1845
1876
-1 /* fail if you forget to update this assert */ ));
1846
1877
1847
1878
tuplestore_putvalues (rsinfo -> setResult , rsinfo -> setDesc , values , nulls );
0 commit comments