[MDEV-7949] Item_field::used_tables() takes 0.29% in OLTP RO Created: 2015-04-09 Updated: 2015-10-29 Resolved: 2015-10-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.1 |
| Fix Version/s: | 10.1.9 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergey Vojtovich | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Epic Link: | Performance: micro optimizations |
| Sprint: | 10.1.6-1, 10.1.6-2, 10.1.8-1, 10.1.9-1 |
| Description |
|
Data comes from Sandy Bridge system running sysbench OLTP RO in 1 thread against 1 table. Call graphs:
This is virtual method which can't be inlined. Most time spent for function call convention. Check if we can revoke it's virtual status. |
| Comments |
| Comment by Oleksandr Byelkin [ 2015-05-12 ] | |||||
|
I doubts we can remove virtual status, but we can check how it is called, frequently such functions called several times in a row instead of 1 call with storing result... | |||||
| Comment by Oleksandr Byelkin [ 2015-05-13 ] | |||||
|
in
above in most cases is just 2 used_tables() call and it looks like workaround for some unfixed bug | |||||
| Comment by Oleksandr Byelkin [ 2015-05-13 ] | |||||
|
Itea: check const_item() calls and if in the class there is used_table_cache use it instead of used_tables() call. UPDATE: it is not a problem because they have const_item_cache. | |||||
| Comment by Oleksandr Byelkin [ 2015-05-17 ] | |||||
|
I analyzed dependencies of used_tables, in theory it can be changed to
but it will require heavy enough refactoring of the way how we work now. In fact now we have 2 ways of getting used tables - precalculation and getting it on the fly. Some dependencies are easy to trace now:
So the changes of removing 'virtual' from used_tables is movement in the right direction (dependencies are not volatile and changes not so frequently so could be traced) but it is too much refactoring for betta and should be done in next version if gain we get really pay for 1-2 weeks of intensive development. Now I'd better fix obvious mistakes and make small improvements. | |||||
| Comment by Oleksandr Byelkin [ 2015-05-17 ] | |||||
|
There are 2 commits: revision-id: b2db8e85422a455a10cd28ef7e44977182528f70
small sixes of used_tables() usage — revision-id: 8b30c0f26c7b35fc73429f85aa35eb3614d60bd8
Part 2: removed hack workaround for bug we do not have. | |||||
| Comment by Sergei Golubchik [ 2015-09-15 ] | |||||
|
Possibly related commit: mysql-5.6.5-gaaacb85 |