@@ -117,7 +117,8 @@ typedef enum pgssVersion
117117	PGSS_V1_3 ,
118118	PGSS_V1_8 ,
119119	PGSS_V1_9 ,
120- 	PGSS_V1_10 
120+ 	PGSS_V1_10 ,
121+ 	PGSS_V1_11 
121122} pgssVersion ;
122123
123124typedef  enum  pgssStoreKind 
@@ -192,6 +193,10 @@ typedef struct Counters
192193	double 		jit_generation_time ;	/* total time to generate jit code */ 
193194	int64 		jit_inlining_count ; /* number of times inlining time has been 
194195									 * > 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+ 
195200	double 		jit_inlining_time ;	/* total time to inline jit code */ 
196201	int64 		jit_optimization_count ; /* number of times optimization time 
197202										 * has been > 0 */ 
@@ -312,6 +317,7 @@ PG_FUNCTION_INFO_V1(pg_stat_statements_1_3);
312317PG_FUNCTION_INFO_V1 (pg_stat_statements_1_8 );
313318PG_FUNCTION_INFO_V1 (pg_stat_statements_1_9 );
314319PG_FUNCTION_INFO_V1 (pg_stat_statements_1_10 );
320+ PG_FUNCTION_INFO_V1 (pg_stat_statements_1_11 );
315321PG_FUNCTION_INFO_V1 (pg_stat_statements );
316322PG_FUNCTION_INFO_V1 (pg_stat_statements_info );
317323
@@ -1398,6 +1404,10 @@ pgss_store(const char *query, uint64 queryId,
13981404			e -> counters .jit_functions  +=  jitusage -> created_functions ;
13991405			e -> counters .jit_generation_time  +=  INSTR_TIME_GET_MILLISEC (jitusage -> generation_counter );
14001406
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+ 
14011411			if  (INSTR_TIME_GET_MILLISEC (jitusage -> inlining_counter ))
14021412				e -> counters .jit_inlining_count ++ ;
14031413			e -> counters .jit_inlining_time  +=  INSTR_TIME_GET_MILLISEC (jitusage -> inlining_counter );
@@ -1460,7 +1470,8 @@ pg_stat_statements_reset(PG_FUNCTION_ARGS)
14601470#define  PG_STAT_STATEMENTS_COLS_V1_8 	32
14611471#define  PG_STAT_STATEMENTS_COLS_V1_9 	33
14621472#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 */ 
14641475
14651476/* 
14661477 * Retrieve statement statistics. 
@@ -1472,6 +1483,16 @@ pg_stat_statements_reset(PG_FUNCTION_ARGS)
14721483 * expected API version is identified by embedding it in the C name of the 
14731484 * function.  Unfortunately we weren't bright enough to do that for 1.1. 
14741485 */ 
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+ 
14751496Datum 
14761497pg_stat_statements_1_10 (PG_FUNCTION_ARGS )
14771498{
@@ -1602,6 +1623,10 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
16021623			if  (api_version  !=  PGSS_V1_10 )
16031624				elog (ERROR , "incorrect number of output arguments" );
16041625			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 ;
16051630		default :
16061631			elog (ERROR , "incorrect number of output arguments" );
16071632	}
@@ -1834,6 +1859,11 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
18341859			values [i ++ ] =  Int64GetDatumFast (tmp .jit_emission_count );
18351860			values [i ++ ] =  Float8GetDatumFast (tmp .jit_emission_time );
18361861		}
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+ 		}
18371867
18381868		Assert (i  ==  (api_version  ==  PGSS_V1_0  ? PG_STAT_STATEMENTS_COLS_V1_0  :
18391869					 api_version  ==  PGSS_V1_1  ? PG_STAT_STATEMENTS_COLS_V1_1  :
@@ -1842,6 +1872,7 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
18421872					 api_version  ==  PGSS_V1_8  ? PG_STAT_STATEMENTS_COLS_V1_8  :
18431873					 api_version  ==  PGSS_V1_9  ? PG_STAT_STATEMENTS_COLS_V1_9  :
18441874					 api_version  ==  PGSS_V1_10  ? PG_STAT_STATEMENTS_COLS_V1_10  :
1875+ 					 api_version  ==  PGSS_V1_11  ? PG_STAT_STATEMENTS_COLS_V1_11  :
18451876					 -1  /* fail if you forget to update this assert */  ));
18461877
18471878		tuplestore_putvalues (rsinfo -> setResult , rsinfo -> setDesc , values , nulls );
0 commit comments