Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
I run sysbench on MariaDB on Windows with Visual Studio sampling profiler , comparing 5.2 and 5.3 performance.
sysbench version is 0.5 and for the test I created select1.lua, which does nothing else but running prepared "SELECT 1".
Performance reports show a big difference inside JOIN constructor, and for this specific test JOIN::JOIN is the most expensive function with 24.23% exclusive samples.
Here is he list of functions that show up as more expensive in 5.3 compared to 5.2
Comparison Column Delta Baseline Value Comparison Value
JOIN::JOIN 23,15 1,08 24,23
RtlpAllocateHeap 3,24 0,00 3,24
RtlpInsertFreeBlock 1,93 0,00 1,93
RtlpFreeHeap 1,42 0,00 1,42
Looking at what has changed from 5.2 to 5.3, JOIN structure grew from around 5K to around 32K. Besides, it contains 2 large arrays of POSITION structures, and POSITION has a non-trivial constructor, since it includes semi-join strategy classes for which virtual function tables must be setup (confirmed by switching to disassembly and single-stepping through JOIN::JOIN)
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Re: JOIN constructors takes a long time in 5.3
Profiling with another test (point_select) shows the same slowdown in JOIN::JOIN. Second expensive call as compared to
5.2 is JON::choose_subquery_plan.
Comparison Delta Baseline Value Comparison Value
JOIN::JOIN 7,83 0,42 8,25
JOIN::choose_subquery_plan 3,47 0,00 3,47
ut_delay 1,55 0,00 1,55
memcpy 1,35 0,00 1,35
RtlpAllocateHeap 1,28 0,00 1,28
For JOIN::choose_subquery_plan function, profiler points at the line at the very start of the function
Join_plan_state save_qep; /* The original QEP of the subquery. */
I suspect that the bottleneck here could be again initialization of the POSITION structures in the best_positions array in
Join_plan_state