Commit 842d79b
committed
sql: use stmt's span for exec stats propagation
Previously, when sampling the statement, we would always create a new
tracing span. However, there is another span that we can use instead:
we always create a tracing span for each statement in
`connExecutor.execCmd`. That span is not used directly for anything and
is needed because the transactions expect that a span is present in
their context. This commit utilizes the present tracing span for the
sampling purposes which gives us a performance boost (some benchmarks
show that this eliminates about a quarter of the performance overhead
with "always on" sampling").
Release justification: low-risk update to new functionality.
Release note: None1 parent bc2a1fc commit 842d79b
2 files changed
Lines changed: 37 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1463 | 1463 | | |
1464 | 1464 | | |
1465 | 1465 | | |
| 1466 | + | |
1466 | 1467 | | |
1467 | 1468 | | |
1468 | 1469 | | |
1469 | 1470 | | |
1470 | 1471 | | |
1471 | 1472 | | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
1472 | 1476 | | |
1473 | 1477 | | |
1474 | 1478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
173 | 183 | | |
174 | 184 | | |
175 | 185 | | |
176 | 186 | | |
177 | 187 | | |
178 | 188 | | |
179 | | - | |
180 | | - | |
181 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
182 | 199 | | |
| 200 | + | |
183 | 201 | | |
184 | 202 | | |
185 | 203 | | |
| |||
190 | 208 | | |
191 | 209 | | |
192 | 210 | | |
| 211 | + | |
193 | 212 | | |
194 | 213 | | |
195 | 214 | | |
| |||
204 | 223 | | |
205 | 224 | | |
206 | 225 | | |
207 | | - | |
208 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
209 | 229 | | |
210 | 230 | | |
211 | 231 | | |
212 | 232 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | 233 | | |
217 | 234 | | |
218 | 235 | | |
| |||
0 commit comments