1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Added more digits to JSON output of double

sprintf() format of double changed from '%lg' to '%-.11lg'

The change was to make it easier to read optimizer trace output
with tables that has millions of records.
This commit is contained in:
Monty
2020-04-17 17:41:49 +03:00
parent 8d74d30dde
commit 27d9986c1b
15 changed files with 837 additions and 730 deletions

View File

@ -73,7 +73,7 @@ explain select * from t1 where a=1 or b=1 {
"range_analysis": {
"table_scan": {
"rows": 1000,
"cost": 231.59
"cost": 231.5878906
},
"potential_range_indexes": [
{
@ -111,12 +111,12 @@ explain select * from t1 where a=1 or b=1 {
"using_mrr": false,
"index_only": true,
"rows": 1,
"cost": 0.3456,
"cost": 0.345585794,
"chosen": true
}
],
"index_to_merge": "a",
"cumulated_cost": 0.3456
"cumulated_cost": 0.345585794
},
{
"range_scan_alternatives": [
@ -127,15 +127,15 @@ explain select * from t1 where a=1 or b=1 {
"using_mrr": false,
"index_only": true,
"rows": 1,
"cost": 0.3456,
"cost": 0.345585794,
"chosen": true
}
],
"index_to_merge": "b",
"cumulated_cost": 0.6912
"cumulated_cost": 0.691171589
}
],
"cost_of_reading_ranges": 0.6912,
"cost_of_reading_ranges": 0.691171589,
"use_roworder_union": true,
"cause": "always cheaper than non roworder retrieval",
"analyzing_roworder_scans": [
@ -158,7 +158,7 @@ explain select * from t1 where a=1 or b=1 {
}
}
],
"index_roworder_union_cost": 2.4849,
"index_roworder_union_cost": 2.484903732,
"members": 2,
"chosen": true
}
@ -187,7 +187,7 @@ explain select * from t1 where a=1 or b=1 {
]
},
"rows_for_plan": 2,
"cost_for_plan": 2.4849,
"cost_for_plan": 2.484903732,
"chosen": true
}
}
@ -209,19 +209,19 @@ explain select * from t1 where a=1 or b=1 {
{
"access_type": "index_merge",
"resulting_rows": 2,
"cost": 2.4849,
"cost": 2.484903732,
"chosen": true
}
],
"chosen_access_method": {
"type": "index_merge",
"records": 2,
"cost": 2.4849,
"cost": 2.484903732,
"uses_join_buffering": false
}
},
"rows_for_plan": 2,
"cost_for_plan": 2.8849,
"cost_for_plan": 2.884903732,
"estimated_join_cardinality": 2
}
]
@ -322,7 +322,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"using_mrr": false,
"index_only": false,
"rows": 2243,
"cost": 2700.1,
"cost": 2700.058937,
"chosen": true
},
@ -336,7 +336,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"using_mrr": false,
"index_only": false,
"rows": 2243,
"cost": 2700.1,
"cost": 2700.058937,
"chosen": false,
"cause": "cost"
},
@ -351,7 +351,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"using_mrr": false,
"index_only": false,
"rows": 2243,
"cost": 2700.1,
"cost": 2700.058937,
"chosen": false,
"cause": "cost"
}
@ -363,10 +363,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
{
"index": "key1",
"index_scan_cost": 10.314,
"cumulated_index_scan_cost": 10.314,
"disk_sweep_cost": 1923.1,
"cumulative_total_cost": 1933.5,
"index_scan_cost": 10.31393703,
"cumulated_index_scan_cost": 10.31393703,
"disk_sweep_cost": 1923.144061,
"cumulative_total_cost": 1933.457998,
"usable": true,
"matching_rows_now": 2243,
"intersect_covering_with_this_index": false,
@ -375,24 +375,24 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
{
"index": "key2",
"index_scan_cost": 10.314,
"cumulated_index_scan_cost": 20.628,
"disk_sweep_cost": 84.518,
"cumulative_total_cost": 105.15,
"index_scan_cost": 10.31393703,
"cumulated_index_scan_cost": 20.62787405,
"disk_sweep_cost": 84.51771758,
"cumulative_total_cost": 105.1455916,
"usable": true,
"matching_rows_now": 77.636,
"matching_rows_now": 77.6360508,
"intersect_covering_with_this_index": false,
"chosen": true
},
{
"index": "key3",
"index_scan_cost": 10.314,
"cumulated_index_scan_cost": 30.942,
"index_scan_cost": 10.31393703,
"cumulated_index_scan_cost": 30.94181108,
"disk_sweep_cost": 0,
"cumulative_total_cost": 30.942,
"cumulative_total_cost": 30.94181108,
"usable": true,
"matching_rows_now": 2.6872,
"matching_rows_now": 2.687185191,
"intersect_covering_with_this_index": true,
"chosen": true
}
@ -403,7 +403,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"cause": "no clustered pk index"
},
"rows": 2,
"cost": 30.942,
"cost": 30.94181108,
"covering": true,
"chosen": true
},
@ -421,7 +421,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
{
"type": "index_roworder_intersect",
"rows": 2,
"cost": 30.942,
"cost": 30.94181108,
"covering": true,
"clustered_pk_scan": false,
"intersect_of":
@ -459,7 +459,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
]
},
"rows_for_plan": 2,
"cost_for_plan": 30.942,
"cost_for_plan": 30.94181108,
"chosen": true
}
]
@ -500,7 +500,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"using_mrr": false,
"index_only": true,
"rows": 2243,
"cost": 457.06,
"cost": 457.058937,
"chosen": true
},
@ -514,13 +514,13 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"using_mrr": false,
"index_only": true,
"rows": 2243,
"cost": 457.06,
"cost": 457.058937,
"chosen": false,
"cause": "cost"
}
],
"index_to_merge": "key1",
"cumulated_cost": 457.06
"cumulated_cost": 457.058937
},
{
@ -537,7 +537,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"using_mrr": false,
"index_only": true,
"rows": 2243,
"cost": 457.06,
"cost": 457.058937,
"chosen": true
},
@ -551,16 +551,16 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"using_mrr": false,
"index_only": true,
"rows": 2243,
"cost": 457.06,
"cost": 457.058937,
"chosen": false,
"cause": "cost"
}
],
"index_to_merge": "key3",
"cumulated_cost": 914.12
"cumulated_cost": 914.1178741
}
],
"cost_of_reading_ranges": 914.12,
"cost_of_reading_ranges": 914.1178741,
"use_roworder_union": true,
"cause": "always cheaper than non roworder retrieval",
"analyzing_roworder_scans":
@ -581,10 +581,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
{
"index": "key1",
"index_scan_cost": 10.314,
"cumulated_index_scan_cost": 10.314,
"disk_sweep_cost": 1923.1,
"cumulative_total_cost": 1933.5,
"index_scan_cost": 10.31393703,
"cumulated_index_scan_cost": 10.31393703,
"disk_sweep_cost": 1923.144061,
"cumulative_total_cost": 1933.457998,
"usable": true,
"matching_rows_now": 2243,
"intersect_covering_with_this_index": false,
@ -593,12 +593,12 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
{
"index": "key2",
"index_scan_cost": 10.314,
"cumulated_index_scan_cost": 20.628,
"disk_sweep_cost": 84.518,
"cumulative_total_cost": 105.15,
"index_scan_cost": 10.31393703,
"cumulated_index_scan_cost": 20.62787405,
"disk_sweep_cost": 84.51771758,
"cumulative_total_cost": 105.1455916,
"usable": true,
"matching_rows_now": 77.636,
"matching_rows_now": 77.6360508,
"intersect_covering_with_this_index": false,
"chosen": true
}
@ -609,7 +609,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"cause": "no clustered pk index"
},
"rows": 77,
"cost": 105.15,
"cost": 105.1455916,
"covering": false,
"chosen": true
}
@ -630,10 +630,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
{
"index": "key3",
"index_scan_cost": 10.314,
"cumulated_index_scan_cost": 10.314,
"disk_sweep_cost": 1923.1,
"cumulative_total_cost": 1933.5,
"index_scan_cost": 10.31393703,
"cumulated_index_scan_cost": 10.31393703,
"disk_sweep_cost": 1923.144061,
"cumulative_total_cost": 1933.457998,
"usable": true,
"matching_rows_now": 2243,
"intersect_covering_with_this_index": false,
@ -642,12 +642,12 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
{
"index": "key4",
"index_scan_cost": 10.314,
"cumulated_index_scan_cost": 20.628,
"disk_sweep_cost": 84.518,
"cumulative_total_cost": 105.15,
"index_scan_cost": 10.31393703,
"cumulated_index_scan_cost": 20.62787405,
"disk_sweep_cost": 84.51771758,
"cumulative_total_cost": 105.1455916,
"usable": true,
"matching_rows_now": 77.636,
"matching_rows_now": 77.6360508,
"intersect_covering_with_this_index": false,
"chosen": true
}
@ -658,13 +658,13 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
"cause": "no clustered pk index"
},
"rows": 77,
"cost": 105.15,
"cost": 105.1455916,
"covering": false,
"chosen": true
}
}
],
"index_roworder_union_cost": 194.98,
"index_roworder_union_cost": 194.9771115,
"members": 2,
"chosen": true
}
@ -685,7 +685,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
{
"type": "index_roworder_intersect",
"rows": 77,
"cost": 105.15,
"cost": 105.1455916,
"covering": false,
"clustered_pk_scan": false,
"intersect_of":
@ -716,7 +716,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
{
"type": "index_roworder_intersect",
"rows": 77,
"cost": 105.15,
"cost": 105.1455916,
"covering": false,
"clustered_pk_scan": false,
"intersect_of":
@ -746,7 +746,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
]
},
"rows_for_plan": 154,
"cost_for_plan": 194.98,
"cost_for_plan": 194.9771115,
"chosen": true
}
]