[MDEV-21784] Performance testing for packed sort keys Created: 2020-02-20 Updated: 2023-10-19 Resolved: 2023-10-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Varun Gupta (Inactive) | Assignee: | Sergei Petrunia |
| Resolution: | Done | Votes: | 0 |
| Labels: | optimizer-perf-test | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
This tasks relates to analysing performance of the implementation of packed sort keys in First part of testing this would be
|
| Comments |
| Comment by Sergei Petrunia [ 2020-02-27 ] | |||||||||||||||||||||||
|
First attempt: https://gist.github.com/spetrunia/959639071622dba51c2805d0e922922e | |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-02-29 ] | |||||||||||||||||||||||
|
Variables that affect the way sorting is done:
| |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-02-29 ] | |||||||||||||||||||||||
|
partially-automated benchmarking script: make-filesort-bench2.sh | |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-03-03 ] | |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-03-07 ] | |||||||||||||||||||||||
|
https://github.com/spetrunia/sort-benchmark,
Results:
| |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-03-07 ] | |||||||||||||||||||||||
|
Tried with a concurrent workload:
"Average number of seconds to run all queries:"
Again about 10% difference. Benchmark script:
| |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-03-09 ] | |||||||||||||||||||||||
|
This difference is surprising. Technically,
but the idea that 2-3 checks like this cause a 10% difference doesn't seem to be plausible. | |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-03-09 ] | |||||||||||||||||||||||
|
Tried this query pattern that's not using sorting at all:
The results:
| |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-03-09 ] | |||||||||||||||||||||||
|
The above hints that the cause of the slowdown is not extra code on the execution path. I've made an experimental patch: https://github.com/MariaDB/server/commits/10.5-mdev21784-reg1-vfuncs
blackbox:
One can see that extra virtual functions alone add about 3% ? Benchmark script revision:
Benchmark output: result-sort-int.aws-c5.overhead.tgz | |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-03-09 ] | |||||||||||||||||||||||
|
Note that this again was not reproducible on CentOS machine. data from the two runs:
here, adding new virtual functions made the queries run slightly faster? | |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-03-09 ] | |||||||||||||||||||||||
|
Varchar benchmark: https://docs.google.com/spreadsheets/d/1uXGeg7-XkHdo0-yvuK5d0d6zxiLUco_At3FmAhHXQdM/edit#gid=0
| |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-03-09 ] | |||||||||||||||||||||||
|
Added another tab:
| |||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-03-13 ] | |||||||||||||||||||||||
|
More tabs added:
| |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2020-09-01 ] | |||||||||||||||||||||||
|
More benchmarks https://docs.google.com/spreadsheets/d/1CqDb--d6gK_pWyecqU76wsmh0p-vVjCmB_uoknz65DY/ |