forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit54b6cd5
committed
Speedup pgstat_report_activity by moving mb-aware truncation to read side.
Previously multi-byte aware truncation was done on everypgstat_report_activity() call - proving to be a bottleneck forworkloads with long query strings that execute quickly.Instead move the truncation to the read side, which commonly isexecuted far less frequently. That's possible because all serverencodings allow to determine the length of a multi-byte string fromthe first byte.Rename PgBackendStatus.st_activity to st_activity_raw so existingextension users of the field break - their code has to be adjusted touse pgstat_clip_activity().Author: Andres FreundTested-By: Khuntal GhoshReviewed-By: Robert Haas, Tom LaneDiscussion:https://postgr.es/m/20170912071948.pa7igbpkkkviecpz@alap3.anarazel.de1 parentd1687c6 commit54b6cd5
File tree
3 files changed
+72
-20
lines changed- src
- backend
- postmaster
- utils/adt
- include
3 files changed
+72
-20
lines changedLines changed: 49 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2701 | 2701 |
| |
2702 | 2702 |
| |
2703 | 2703 |
| |
2704 |
| - | |
| 2704 | + | |
2705 | 2705 |
| |
2706 | 2706 |
| |
2707 | 2707 |
| |
| |||
2922 | 2922 |
| |
2923 | 2923 |
| |
2924 | 2924 |
| |
2925 |
| - | |
| 2925 | + | |
2926 | 2926 |
| |
2927 | 2927 |
| |
2928 | 2928 |
| |
2929 |
| - | |
| 2929 | + | |
2930 | 2930 |
| |
2931 | 2931 |
| |
2932 | 2932 |
| |
| |||
3017 | 3017 |
| |
3018 | 3018 |
| |
3019 | 3019 |
| |
3020 |
| - | |
| 3020 | + | |
3021 | 3021 |
| |
3022 | 3022 |
| |
3023 | 3023 |
| |
| |||
3034 | 3034 |
| |
3035 | 3035 |
| |
3036 | 3036 |
| |
3037 |
| - | |
3038 |
| - | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
3039 | 3043 |
| |
3040 | 3044 |
| |
3041 | 3045 |
| |
| |||
3049 | 3053 |
| |
3050 | 3054 |
| |
3051 | 3055 |
| |
3052 |
| - | |
3053 |
| - | |
| 3056 | + | |
| 3057 | + | |
3054 | 3058 |
| |
3055 | 3059 |
| |
3056 | 3060 |
| |
| |||
3278 | 3282 |
| |
3279 | 3283 |
| |
3280 | 3284 |
| |
3281 |
| - | |
3282 |
| - | |
| 3285 | + | |
| 3286 | + | |
3283 | 3287 |
| |
3284 | 3288 |
| |
3285 | 3289 |
| |
| |||
3945 | 3949 |
| |
3946 | 3950 |
| |
3947 | 3951 |
| |
3948 |
| - | |
| 3952 | + | |
3949 | 3953 |
| |
3950 | 3954 |
| |
3951 |
| - | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
3952 | 3959 |
| |
3953 | 3960 |
| |
3954 | 3961 |
| |
| |||
3994 | 4001 |
| |
3995 | 4002 |
| |
3996 | 4003 |
| |
3997 |
| - | |
| 4004 | + | |
3998 | 4005 |
| |
3999 | 4006 |
| |
4000 | 4007 |
| |
| |||
4017 | 4024 |
| |
4018 | 4025 |
| |
4019 | 4026 |
| |
4020 |
| - | |
| 4027 | + | |
| 4028 | + | |
4021 | 4029 |
| |
4022 | 4030 |
| |
4023 | 4031 |
| |
| |||
6270 | 6278 |
| |
6271 | 6279 |
| |
6272 | 6280 |
| |
| 6281 | + | |
| 6282 | + | |
| 6283 | + | |
| 6284 | + | |
| 6285 | + | |
| 6286 | + | |
| 6287 | + | |
| 6288 | + | |
| 6289 | + | |
| 6290 | + | |
| 6291 | + | |
| 6292 | + | |
| 6293 | + | |
| 6294 | + | |
| 6295 | + | |
| 6296 | + | |
| 6297 | + | |
| 6298 | + | |
| 6299 | + | |
| 6300 | + | |
| 6301 | + | |
| 6302 | + | |
| 6303 | + | |
| 6304 | + | |
| 6305 | + | |
| 6306 | + | |
| 6307 | + |
Lines changed: 13 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
664 | 664 |
| |
665 | 665 |
| |
666 | 666 |
| |
| 667 | + | |
667 | 668 |
| |
668 | 669 |
| |
669 | 670 |
| |
| |||
690 | 691 |
| |
691 | 692 |
| |
692 | 693 |
| |
693 |
| - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
694 | 697 |
| |
695 | 698 |
| |
696 | 699 |
| |
| |||
906 | 909 |
| |
907 | 910 |
| |
908 | 911 |
| |
| 912 | + | |
| 913 | + | |
909 | 914 |
| |
910 | 915 |
| |
911 | 916 |
| |
912 | 917 |
| |
913 | 918 |
| |
914 |
| - | |
| 919 | + | |
915 | 920 |
| |
916 | 921 |
| |
917 |
| - | |
| 922 | + | |
918 | 923 |
| |
919 |
| - | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
920 | 929 |
| |
921 | 930 |
| |
922 | 931 |
| |
|
Lines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1003 | 1003 |
| |
1004 | 1004 |
| |
1005 | 1005 |
| |
1006 |
| - | |
1007 |
| - | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
1008 | 1014 |
| |
1009 | 1015 |
| |
1010 | 1016 |
| |
| |||
1193 | 1199 |
| |
1194 | 1200 |
| |
1195 | 1201 |
| |
| 1202 | + | |
| 1203 | + | |
1196 | 1204 |
| |
1197 | 1205 |
| |
1198 | 1206 |
| |
|
0 commit comments
Comments
(0)