forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6b4d23f
committed
Track identical top vs nested queries independently in pg_stat_statements
Changing pg_stat_statements.track between 'all' and 'top' would controlif pg_stat_statements tracked just top level statements or alsostatements inside functions, but when tracking all it would notdifferentiate between the two. Being table to differentiate this isuseful both to track where the actual query is coming from, and to seeif there are differences in executions between the two.To do this, add a boolean to the hash key indicating if the statementwas top level or not.Experience from the pg_stat_kcache module shows that in at least some"reasonable worloads" only <5% of the queries show up both top level andnested. Based on this, admittedly small, dataset, this patch does nottry to de-duplicate those query *texts*, and will just store one copyfor the top level and one for the nested.Author: Julien RohaudReviewed-By: Magnus Hagander, Masahiro IkedaDiscussion:https://postgr.es/m/20201202040516.GA43757@nol1 parent2e0e066 commit6b4d23f
File tree
7 files changed
+173
-9
lines changed- contrib/pg_stat_statements
- expected
- sql
- doc/src/sgml
7 files changed
+173
-9
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
| 10 | + | |
10 | 11 |
| |
11 | 12 |
| |
12 | 13 |
| |
|
Lines changed: 40 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
901 | 901 |
| |
902 | 902 |
| |
903 | 903 |
| |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
904 | 944 |
|
Lines changed: 57 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + |
Lines changed: 43 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
90 |
| - | |
| 90 | + | |
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
| |||
119 | 119 |
| |
120 | 120 |
| |
121 | 121 |
| |
122 |
| - | |
| 122 | + | |
| 123 | + | |
123 | 124 |
| |
124 | 125 |
| |
125 | 126 |
| |
| |||
141 | 142 |
| |
142 | 143 |
| |
143 | 144 |
| |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
148 | 149 |
| |
149 | 150 |
| |
150 | 151 |
| |
151 | 152 |
| |
152 | 153 |
| |
153 | 154 |
| |
| 155 | + | |
154 | 156 |
| |
155 | 157 |
| |
156 | 158 |
| |
| |||
297 | 299 |
| |
298 | 300 |
| |
299 | 301 |
| |
| 302 | + | |
300 | 303 |
| |
301 | 304 |
| |
302 | 305 |
| |
| |||
1224 | 1227 |
| |
1225 | 1228 |
| |
1226 | 1229 |
| |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
1227 | 1234 |
| |
1228 | 1235 |
| |
1229 | 1236 |
| |
| 1237 | + | |
1230 | 1238 |
| |
1231 | 1239 |
| |
1232 | 1240 |
| |
| |||
1406 | 1414 |
| |
1407 | 1415 |
| |
1408 | 1416 |
| |
1409 |
| - | |
| 1417 | + | |
| 1418 | + | |
1410 | 1419 |
| |
1411 | 1420 |
| |
1412 | 1421 |
| |
| |||
1418 | 1427 |
| |
1419 | 1428 |
| |
1420 | 1429 |
| |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
1421 | 1440 |
| |
1422 | 1441 |
| |
1423 | 1442 |
| |
| |||
1537 | 1556 |
| |
1538 | 1557 |
| |
1539 | 1558 |
| |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
1540 | 1563 |
| |
1541 | 1564 |
| |
1542 | 1565 |
| |
| |||
1628 | 1651 |
| |
1629 | 1652 |
| |
1630 | 1653 |
| |
| 1654 | + | |
| 1655 | + | |
1631 | 1656 |
| |
1632 | 1657 |
| |
1633 | 1658 |
| |
| |||
1765 | 1790 |
| |
1766 | 1791 |
| |
1767 | 1792 |
| |
| 1793 | + | |
1768 | 1794 |
| |
1769 | 1795 |
| |
1770 | 1796 |
| |
| |||
2437 | 2463 |
| |
2438 | 2464 |
| |
2439 | 2465 |
| |
| 2466 | + | |
2440 | 2467 |
| |
2441 | 2468 |
| |
2442 | 2469 |
| |
2443 | 2470 |
| |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
2444 | 2480 |
| |
2445 | 2481 |
| |
2446 | 2482 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
364 | 364 |
| |
365 | 365 |
| |
366 | 366 |
| |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
367 | 388 |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
90 | 99 |
| |
91 | 100 |
| |
92 | 101 |
| |
|
0 commit comments
Comments
(0)