[MDEV-17930] Optimizer trace: what's on the execution path when trace=off? Created: 2018-12-07 Updated: 2019-04-10 Resolved: 2019-04-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Need to check again what is on the execution path (and so adds CPU overhead), when the tracing is not enabled. The original tracing proposal had everything wrapped inside if-statements, something like
With tracing code using RAII objects, we can't have everything inside if-s. |
| Comments |
| Comment by Sergei Petrunia [ 2018-12-11 ] | |||||||||||||||
|
Examples from MySQL 8.0 codebase:
Opt_trace_array ctor:
Opt_trace struct constructor:
The destructor is also on the execution path
| |||||||||||||||
| Comment by Sergei Petrunia [ 2018-12-12 ] | |||||||||||||||
|
Besides creating/deleting the RAII tracing objects, the code also has calls to print things into trace:
The printing methods start with a check of whether the trace is enabled:
| |||||||||||||||
| Comment by Sergei Petrunia [ 2018-12-12 ] | |||||||||||||||
SummaryWhen the optimizer trace is off, the following things are on the execution path:
I think this is as good as one can reasonably get. | |||||||||||||||
| Comment by Sergei Petrunia [ 2019-04-10 ] | |||||||||||||||
|
Closing as "Done" |