forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit31de7e6
committed
Show savepoint names as constants in pg_stat_statements
In pg_stat_statements, savepoint names now show up as constants with aparameter symbol, using as base query string the one added as a newentry to the PGSS hash table, leading to:RELEASE $1ROLLBACK TO $1SAVEPOINT $1Applying constants to these query parts is a huge advantage forworkloads that generate randomly savepoint points, like ORMs (Django isat the origin of this patch). The ODBC driver is a second layer thatlikes a lot savepoints, though it does not use a random naming pattern.A "location" field is added to TransactionStmt, now set only forsavepoints. The savepoint name is ignored by the query jumbling. Thelocation can be extended to other query patterns, if required, like 2PCcommands. Some tests are added to pg_stat_statements for all the querypatterns supported by the parser.ROLLBACK, ROLLBACK TO SAVEPOINT and ROLLBACK TRANSACTION TO SAVEPOINThave the same Node representation, so all these are equivalents. Thesame happens for RELEASE and RELEASE SAVEPOINT.Author: Greg Sabino MullaneDiscussion:https://postgr.es/m/CAKAnmm+2s9PA4OaumwMJReWHk8qvJ_-g1WqxDRDAN1BSUfxyTw@mail.gmail.com1 parent19c590f commit31de7e6
File tree
4 files changed
+66
-1
lines changed- contrib/pg_stat_statements
- expected
- sql
- src
- backend/parser
- include/nodes
4 files changed
+66
-1
lines changedLines changed: 31 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
197 | 197 |
| |
198 | 198 |
| |
199 | 199 |
| |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
200 | 231 |
| |
201 | 232 |
| |
202 | 233 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
115 | 115 |
| |
116 | 116 |
| |
117 | 117 |
| |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
118 | 135 |
| |
119 | 136 |
| |
120 | 137 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10841 | 10841 |
| |
10842 | 10842 |
| |
10843 | 10843 |
| |
| 10844 | + | |
10844 | 10845 |
| |
10845 | 10846 |
| |
10846 | 10847 |
| |
| |||
10849 | 10850 |
| |
10850 | 10851 |
| |
10851 | 10852 |
| |
| 10853 | + | |
10852 | 10854 |
| |
10853 | 10855 |
| |
10854 | 10856 |
| |
| |||
10858 | 10860 |
| |
10859 | 10861 |
| |
10860 | 10862 |
| |
| 10863 | + | |
10861 | 10864 |
| |
10862 | 10865 |
| |
10863 | 10866 |
| |
| |||
10867 | 10870 |
| |
10868 | 10871 |
| |
10869 | 10872 |
| |
| 10873 | + | |
10870 | 10874 |
| |
10871 | 10875 |
| |
10872 | 10876 |
| |
| |||
10875 | 10879 |
| |
10876 | 10880 |
| |
10877 | 10881 |
| |
| 10882 | + | |
10878 | 10883 |
| |
10879 | 10884 |
| |
10880 | 10885 |
| |
| |||
10883 | 10888 |
| |
10884 | 10889 |
| |
10885 | 10890 |
| |
| 10891 | + | |
10886 | 10892 |
| |
10887 | 10893 |
| |
10888 | 10894 |
| |
| |||
10891 | 10897 |
| |
10892 | 10898 |
| |
10893 | 10899 |
| |
| 10900 | + | |
10894 | 10901 |
| |
10895 | 10902 |
| |
10896 | 10903 |
| |
| |||
10899 | 10906 |
| |
10900 | 10907 |
| |
10901 | 10908 |
| |
| 10909 | + | |
10902 | 10910 |
| |
10903 | 10911 |
| |
10904 | 10912 |
| |
| |||
10907 | 10915 |
| |
10908 | 10916 |
| |
10909 | 10917 |
| |
| 10918 | + | |
10910 | 10919 |
| |
10911 | 10920 |
| |
10912 | 10921 |
| |
| |||
10915 | 10924 |
| |
10916 | 10925 |
| |
10917 | 10926 |
| |
| 10927 | + | |
10918 | 10928 |
| |
10919 | 10929 |
| |
10920 | 10930 |
| |
| |||
10923 | 10933 |
| |
10924 | 10934 |
| |
10925 | 10935 |
| |
| 10936 | + | |
10926 | 10937 |
| |
10927 | 10938 |
| |
10928 | 10939 |
| |
| |||
10931 | 10942 |
| |
10932 | 10943 |
| |
10933 | 10944 |
| |
| 10945 | + | |
10934 | 10946 |
| |
10935 | 10947 |
| |
10936 | 10948 |
| |
| |||
10942 | 10954 |
| |
10943 | 10955 |
| |
10944 | 10956 |
| |
| 10957 | + | |
10945 | 10958 |
| |
10946 | 10959 |
| |
10947 | 10960 |
| |
| |||
10951 | 10964 |
| |
10952 | 10965 |
| |
10953 | 10966 |
| |
| 10967 | + | |
10954 | 10968 |
| |
10955 | 10969 |
| |
10956 | 10970 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3538 | 3538 |
| |
3539 | 3539 |
| |
3540 | 3540 |
| |
3541 |
| - | |
| 3541 | + | |
| 3542 | + | |
3542 | 3543 |
| |
3543 | 3544 |
| |
| 3545 | + | |
| 3546 | + | |
3544 | 3547 |
| |
3545 | 3548 |
| |
3546 | 3549 |
| |
|
0 commit comments
Comments
(0)