forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitac99802
committed
Speed up creation of command completion tags
The building of command completion tags could often be seen showing up inprofiles when running high tps workloads.The query completion tags were being built with snprintf, which is slow atthe best of times when compared with more manual ways of formattingstrings. Here we introduce BuildQueryCompletionString() to do this jobfor us. We also now store the completion tag's strlen in theCommandTagBehavior struct so that we can quickly memcpy this number ofbytes into the completion tag string. Appending the rows affected is donevia pg_ulltoa_n. BuildQueryCompletionString returns the length of thebuilt string. This saves us having to call strlen to figure out how manybytes to pass to pq_putmessage().Author: David Rowley, Andres FreundReviewed-by: Andres FreundDiscussion:https://postgr.es/m/CAHoyFK-Xwqc-iY52shj0G+8K9FJpse+FuZ36XBKy78wDVnd=Qg@mail.gmail.com1 parentd35a1af commitac99802
4 files changed
+78
-30
lines changedLines changed: 69 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
18 | 19 |
| |
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
22 |
| - | |
| 23 | + | |
| 24 | + | |
23 | 25 |
| |
24 | 26 |
| |
25 |
| - | |
| 27 | + | |
| 28 | + | |
26 | 29 |
| |
27 | 30 |
| |
28 | 31 |
| |
29 |
| - | |
| 32 | + | |
30 | 33 |
| |
31 | 34 |
| |
32 | 35 |
| |
| |||
47 | 50 |
| |
48 | 51 |
| |
49 | 52 |
| |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
50 | 60 |
| |
51 | 61 |
| |
52 | 62 |
| |
| |||
96 | 106 |
| |
97 | 107 |
| |
98 | 108 |
| |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + |
Lines changed: 4 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
169 |
| - | |
170 |
| - | |
| 169 | + | |
171 | 170 |
| |
172 | 171 |
| |
173 | 172 |
| |
174 | 173 |
| |
175 | 174 |
| |
176 | 175 |
| |
177 | 176 |
| |
178 |
| - | |
179 |
| - | |
180 |
| - | |
181 |
| - | |
182 |
| - | |
183 |
| - | |
184 |
| - | |
185 |
| - | |
186 |
| - | |
187 |
| - | |
188 |
| - | |
189 |
| - | |
190 |
| - | |
191 |
| - | |
192 |
| - | |
193 |
| - | |
194 |
| - | |
195 |
| - | |
196 |
| - | |
197 |
| - | |
198 |
| - | |
199 |
| - | |
200 |
| - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
201 | 180 |
| |
202 | 181 |
| |
203 | 182 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| 16 | + | |
| 17 | + | |
16 | 18 |
| |
17 | 19 |
| |
18 | 20 |
| |
| |||
50 | 52 |
| |
51 | 53 |
| |
52 | 54 |
| |
| 55 | + | |
53 | 56 |
| |
54 | 57 |
| |
55 | 58 |
| |
56 | 59 |
| |
| 60 | + | |
| 61 | + | |
57 | 62 |
| |
58 | 63 |
|
Lines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
74 |
| - | |
75 |
| - | |
76 | 74 |
| |
77 | 75 |
| |
78 | 76 |
| |
|
0 commit comments
Comments
(0)