Commit bb45156
committed
Show names of DEALLOCATE as constants in pg_stat_statements
This commit switches query jumbling so as prepared statement names are
treated as constants in DeallocateStmt. A boolean field is added to
DeallocateStmt to make a distinction between ALL and named prepared
statements, as "name" was used to make this difference before, NULL
meaning DEALLOCATE ALL.
Prior to this commit, DEALLOCATE was not tracked in pg_stat_statements,
for the reason that it was not possible to treat its name parameter as a
constant. Now that query jumbling applies to all the utility nodes,
this reason does not apply anymore.
Like 638d42a, this can be a huge advantage for monitoring where
prepared statement names are randomly generated, preventing bloat in
pg_stat_statements. A couple of tests are added to track the new
behavior.
Author: Dagfinn Ilmari Mannsåker, Michael Paquier
Reviewed-by: Julien Rouhaud
Discussion: https://postgr.es/m/ZMhT9kNtJJsHw6jK@paquier.xyz1 parent e48b19c commit bb45156
File tree
5 files changed
+70
-8
lines changed- contrib/pg_stat_statements
- expected
- sql
- src
- backend/parser
- include/nodes
5 files changed
+70
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
475 | 516 | | |
476 | 517 | | |
477 | 518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
| 107 | + | |
109 | 108 | | |
110 | 109 | | |
111 | 110 | | |
| |||
830 | 829 | | |
831 | 830 | | |
832 | 831 | | |
833 | | - | |
834 | | - | |
| 832 | + | |
835 | 833 | | |
836 | 834 | | |
837 | 835 | | |
| |||
1116 | 1114 | | |
1117 | 1115 | | |
1118 | 1116 | | |
1119 | | - | |
1120 | | - | |
1121 | 1117 | | |
1122 | 1118 | | |
1123 | 1119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
240 | 253 | | |
241 | 254 | | |
242 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11953 | 11953 | | |
11954 | 11954 | | |
11955 | 11955 | | |
| 11956 | + | |
| 11957 | + | |
11956 | 11958 | | |
11957 | 11959 | | |
11958 | 11960 | | |
11959 | 11961 | | |
11960 | 11962 | | |
11961 | 11963 | | |
11962 | 11964 | | |
| 11965 | + | |
| 11966 | + | |
11963 | 11967 | | |
11964 | 11968 | | |
11965 | 11969 | | |
11966 | 11970 | | |
11967 | 11971 | | |
11968 | 11972 | | |
11969 | 11973 | | |
| 11974 | + | |
| 11975 | + | |
11970 | 11976 | | |
11971 | 11977 | | |
11972 | 11978 | | |
11973 | 11979 | | |
11974 | 11980 | | |
11975 | 11981 | | |
11976 | 11982 | | |
| 11983 | + | |
| 11984 | + | |
11977 | 11985 | | |
11978 | 11986 | | |
11979 | 11987 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3929 | 3929 | | |
3930 | 3930 | | |
3931 | 3931 | | |
3932 | | - | |
3933 | | - | |
| 3932 | + | |
| 3933 | + | |
| 3934 | + | |
| 3935 | + | |
| 3936 | + | |
| 3937 | + | |
3934 | 3938 | | |
3935 | 3939 | | |
3936 | 3940 | | |
| |||
0 commit comments