aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2023-09-28 15:17:55 +0900
committerMichael Paquier <michael@paquier.xyz>2023-09-28 15:17:55 +0900
commit11c34b342bd77a292b625c32b70b44c02db8f3ed (patch)
tree74dabe1f42525f0c57f096a8f664438b3ac57967 /src
parentd060e921ea5aa47b6265174c32e1128cebdbc3df (diff)
downloadpostgresql-11c34b342bd77a292b625c32b70b44c02db8f3ed.tar.gz
postgresql-11c34b342bd77a292b625c32b70b44c02db8f3ed.zip
Show parameters of CALL as constants in pg_stat_statements
This commit changes the query jumbling of CallStmt so as its IN/OUT parameters are able to show up as constants with a parameter symbol in pg_stat_statements, like: CALL proc1($1, $2); CALL proc2($1, $2, $3); The transformed FuncExpr is used in the query ID computation instead of the FuncCall generated by the parser, so as it is sensitive to the OID of the procedure and its list of input arguments. The output arguments are handled in a separate list in CallStmt, which is also included in the computation. Tests are added to pg_stat_statements to show how this affects CALL with IN/OUT parameters as well as overloaded functions. Like 638d42a3c520 or 31de7e60da34, this improves the monitoring of workloads with a lot of CALL statements, preventing unnecessary bloat when these use different input (or event output) values. Author: Sami Imseih Discussion: https://postgr.es/m/B44FA29D-EBD0-4DD9-ABC2-16F1CB087074@amazon.com
Diffstat (limited to 'src')
-rw-r--r--src/include/nodes/parsenodes.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index fef4c714b8e..f637937cd20 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -3376,11 +3376,12 @@ typedef struct InlineCodeBlock
typedef struct CallStmt
{
NodeTag type;
- FuncCall *funccall; /* from the parser */
+ /* from the parser */
+ FuncCall *funccall pg_node_attr(query_jumble_ignore);
/* transformed call, with only input args */
- FuncExpr *funcexpr pg_node_attr(query_jumble_ignore);
+ FuncExpr *funcexpr;
/* transformed output-argument expressions */
- List *outargs pg_node_attr(query_jumble_ignore);
+ List *outargs;
} CallStmt;
typedef struct CallContext