mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Make trace.add() usage uniform
- Before any multiple add() calls, always use (if trace_started()). - Add unlikely() around all tests of trace_started(). - Change trace.add(); trace.add(); to trace.add().add(); - When trace.add() goes over several line, use the following formating: trace. add(xxx). add(yyy). add(zzz); This format was choosen after a discussion between Sergei Petrunia and me as it looks similar indepedent if 'trace' is an object or a pointer. It also more suitable for an editors auto-indentation. Other things: Added DBUG_ASSERT(thd->trace_started()) to a few functions that should only be called if trace is enabled. "use_roworder_index_merge: true" changed to "use_sort_index_merge: false" As the original output was often not correct. Also fixed the related 'cause' to be correct. In best_access_path() print the cost (and number of rows) before checking if it the plan should be used. This removes the need to print the cost in two places. Changed a few "read_time" tags to "cost".
This commit is contained in:
@ -51,6 +51,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
|
||||
"rows": 104,
|
||||
"cond_check_cost": 124.96562,
|
||||
"startup_cost": 0,
|
||||
"rows_after_filter": 104,
|
||||
"cost": 124.96562,
|
||||
"chosen": true
|
||||
},
|
||||
@ -61,6 +62,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
|
||||
"rows": 340,
|
||||
"cond_check_cost": 408.2577963,
|
||||
"startup_cost": 0,
|
||||
"rows_after_filter": 340,
|
||||
"cost": 408.2577963,
|
||||
"chosen": false,
|
||||
"cause": "cost"
|
||||
@ -72,6 +74,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
|
||||
"rows": 632,
|
||||
"cond_check_cost": 758.7718449,
|
||||
"startup_cost": 0,
|
||||
"rows_after_filter": 632,
|
||||
"cost": 758.7718449,
|
||||
"chosen": false,
|
||||
"cause": "cost"
|
||||
@ -145,6 +148,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
|
||||
"rows": 6,
|
||||
"cond_check_cost": 7.327343464,
|
||||
"startup_cost": 0,
|
||||
"rows_after_filter": 6,
|
||||
"cost": 7.327343464,
|
||||
"chosen": true
|
||||
},
|
||||
@ -155,6 +159,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
|
||||
"rows": 232,
|
||||
"cond_check_cost": 278.6156139,
|
||||
"startup_cost": 0,
|
||||
"rows_after_filter": 232,
|
||||
"cost": 278.6156139,
|
||||
"chosen": false,
|
||||
"cause": "cost"
|
||||
@ -166,6 +171,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
|
||||
"rows": 293,
|
||||
"cond_check_cost": 351.8394392,
|
||||
"startup_cost": 0,
|
||||
"rows_after_filter": 293,
|
||||
"cost": 351.8394392,
|
||||
"chosen": false,
|
||||
"cause": "cost"
|
||||
|
Reference in New Issue
Block a user