mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-30032: EXPLAIN FORMAT=JSON output: print costs
Basic printout for join and table execution costs.
This commit is contained in:
@ -1339,12 +1339,14 @@ EXPLAIN
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "<derived4>",
|
||||
"access_type": "ALL",
|
||||
"rows": 24,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100,
|
||||
"materialized": {
|
||||
"query_block": {
|
||||
@ -1355,12 +1357,14 @@ EXPLAIN
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 4,
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "folks",
|
||||
"access_type": "ALL",
|
||||
"rows": 12,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100,
|
||||
"attached_condition": "folks.`name` = 'Me2'"
|
||||
}
|
||||
@ -1372,12 +1376,14 @@ EXPLAIN
|
||||
"query_block": {
|
||||
"select_id": 6,
|
||||
"operation": "UNION",
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "<derived3>",
|
||||
"access_type": "ALL",
|
||||
"rows": 12,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100,
|
||||
"attached_condition": "prev_gen.`id` < 345",
|
||||
"materialized": {
|
||||
@ -1389,12 +1395,14 @@ EXPLAIN
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 3,
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "folks",
|
||||
"access_type": "ALL",
|
||||
"rows": 12,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100,
|
||||
"attached_condition": "folks.`name` = 'Me'"
|
||||
}
|
||||
@ -1406,6 +1414,7 @@ EXPLAIN
|
||||
"query_block": {
|
||||
"select_id": 2,
|
||||
"operation": "UNION",
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
@ -1413,6 +1422,7 @@ EXPLAIN
|
||||
"access_type": "ALL",
|
||||
"possible_keys": ["PRIMARY"],
|
||||
"rows": 12,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100
|
||||
}
|
||||
},
|
||||
@ -1422,6 +1432,7 @@ EXPLAIN
|
||||
"table_name": "<derived3>",
|
||||
"access_type": "ALL",
|
||||
"rows": 12,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100
|
||||
},
|
||||
"buffer_type": "flat",
|
||||
@ -1446,12 +1457,14 @@ EXPLAIN
|
||||
"query_block": {
|
||||
"select_id": 5,
|
||||
"operation": "UNION",
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "<derived4>",
|
||||
"access_type": "ALL",
|
||||
"rows": 24,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100,
|
||||
"attached_condition": "ancestors.`id` < 234"
|
||||
}
|
||||
@ -1499,12 +1512,14 @@ EXPLAIN
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "<derived3>",
|
||||
"access_type": "ALL",
|
||||
"rows": 12,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100,
|
||||
"materialized": {
|
||||
"query_block": {
|
||||
@ -1515,12 +1530,14 @@ EXPLAIN
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 3,
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "v",
|
||||
"access_type": "ALL",
|
||||
"rows": 12,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100,
|
||||
"attached_condition": "v.`name` = 'Me' and v.father is not null and v.mother is not null"
|
||||
}
|
||||
@ -1535,6 +1552,7 @@ EXPLAIN
|
||||
"used_key_parts": ["id"],
|
||||
"ref": ["test.v.father"],
|
||||
"rows": 1,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100
|
||||
}
|
||||
},
|
||||
@ -1548,6 +1566,7 @@ EXPLAIN
|
||||
"used_key_parts": ["id"],
|
||||
"ref": ["test.v.mother"],
|
||||
"rows": 1,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100
|
||||
}
|
||||
}
|
||||
@ -1558,12 +1577,14 @@ EXPLAIN
|
||||
"query_block": {
|
||||
"select_id": 2,
|
||||
"operation": "UNION",
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "<derived4>",
|
||||
"access_type": "ALL",
|
||||
"rows": 2,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100,
|
||||
"attached_condition": "a.father is not null and a.mother is not null"
|
||||
}
|
||||
@ -1578,6 +1599,7 @@ EXPLAIN
|
||||
"used_key_parts": ["id"],
|
||||
"ref": ["a.father"],
|
||||
"rows": 1,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100
|
||||
}
|
||||
},
|
||||
@ -1591,6 +1613,7 @@ EXPLAIN
|
||||
"used_key_parts": ["id"],
|
||||
"ref": ["a.mother"],
|
||||
"rows": 1,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100
|
||||
}
|
||||
}
|
||||
@ -1824,12 +1847,14 @@ EXPLAIN
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "<derived2>",
|
||||
"access_type": "ALL",
|
||||
"rows": 10,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100,
|
||||
"materialized": {
|
||||
"query_block": {
|
||||
@ -1840,12 +1865,14 @@ EXPLAIN
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 2,
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "t1",
|
||||
"access_type": "ALL",
|
||||
"rows": 10,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100
|
||||
}
|
||||
}
|
||||
@ -1856,12 +1883,14 @@ EXPLAIN
|
||||
"query_block": {
|
||||
"select_id": 3,
|
||||
"operation": "UNION",
|
||||
"cost": "COST_REPLACED",
|
||||
"nested_loop": [
|
||||
{
|
||||
"table": {
|
||||
"table_name": "<derived2>",
|
||||
"access_type": "ALL",
|
||||
"rows": 10,
|
||||
"cost": "COST_REPLACED",
|
||||
"filtered": 100,
|
||||
"attached_condition": "t.a < 1000"
|
||||
}
|
||||
@ -2460,6 +2489,7 @@ ANALYZE
|
||||
},
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"cost": "REPLACED",
|
||||
"r_loops": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"nested_loop": [
|
||||
@ -2470,6 +2500,7 @@ ANALYZE
|
||||
"r_loops": 1,
|
||||
"rows": 2,
|
||||
"r_rows": 10,
|
||||
"cost": "REPLACED",
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
@ -2494,6 +2525,7 @@ ANALYZE
|
||||
"query_block": {
|
||||
"select_id": 3,
|
||||
"operation": "UNION",
|
||||
"cost": "REPLACED",
|
||||
"r_loops": 10,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"nested_loop": [
|
||||
@ -2504,6 +2536,7 @@ ANALYZE
|
||||
"r_loops": 10,
|
||||
"rows": 2,
|
||||
"r_rows": 1,
|
||||
"cost": "REPLACED",
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
@ -3869,6 +3902,7 @@ ANALYZE
|
||||
},
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"cost": "REPLACED",
|
||||
"r_loops": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"nested_loop": [
|
||||
@ -3879,6 +3913,7 @@ ANALYZE
|
||||
"r_loops": 1,
|
||||
"rows": 3,
|
||||
"r_rows": 3,
|
||||
"cost": "REPLACED",
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
@ -3898,6 +3933,7 @@ ANALYZE
|
||||
"r_loops": 3,
|
||||
"rows": 1,
|
||||
"r_rows": 0.333333333,
|
||||
"cost": "REPLACED",
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
@ -3941,6 +3977,7 @@ ANALYZE
|
||||
"query_block": {
|
||||
"select_id": 4,
|
||||
"operation": "UNION",
|
||||
"cost": "REPLACED",
|
||||
"r_loops": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"nested_loop": [
|
||||
@ -3952,6 +3989,7 @@ ANALYZE
|
||||
"r_loops": 1,
|
||||
"rows": 14,
|
||||
"r_rows": 14,
|
||||
"cost": "REPLACED",
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
@ -3971,6 +4009,7 @@ ANALYZE
|
||||
"r_loops": 14,
|
||||
"rows": 1,
|
||||
"r_rows": 0.071428571,
|
||||
"cost": "REPLACED",
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
@ -4145,6 +4184,7 @@ ANALYZE
|
||||
"query_block": {
|
||||
"select_id": 4,
|
||||
"operation": "UNION",
|
||||
"cost": "REPLACED",
|
||||
"r_loops": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"nested_loop": [
|
||||
@ -4155,6 +4195,7 @@ ANALYZE
|
||||
"r_loops": 1,
|
||||
"rows": 4,
|
||||
"r_rows": 4,
|
||||
"cost": "REPLACED",
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
@ -4170,6 +4211,7 @@ ANALYZE
|
||||
{
|
||||
"query_block": {
|
||||
"select_id": 2,
|
||||
"cost": "REPLACED",
|
||||
"r_loops": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"nested_loop": [
|
||||
@ -4180,6 +4222,7 @@ ANALYZE
|
||||
"r_loops": 1,
|
||||
"rows": 4,
|
||||
"r_rows": 4,
|
||||
"cost": "REPLACED",
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
@ -4193,6 +4236,7 @@ ANALYZE
|
||||
"query_block": {
|
||||
"select_id": 3,
|
||||
"operation": "UNION",
|
||||
"cost": "REPLACED",
|
||||
"r_loops": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"nested_loop": [
|
||||
@ -4203,6 +4247,7 @@ ANALYZE
|
||||
"r_loops": 1,
|
||||
"rows": 4,
|
||||
"r_rows": 4,
|
||||
"cost": "REPLACED",
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
@ -4222,6 +4267,7 @@ ANALYZE
|
||||
"r_loops": 4,
|
||||
"rows": 2,
|
||||
"r_rows": 0.5,
|
||||
"cost": "REPLACED",
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
@ -4300,6 +4346,7 @@ ANALYZE
|
||||
},
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"cost": "REPLACED",
|
||||
"r_loops": 1,
|
||||
"r_total_time_ms": "REPLACED",
|
||||
"nested_loop": [
|
||||
@ -4310,6 +4357,7 @@ ANALYZE
|
||||
"r_loops": 1,
|
||||
"rows": 4,
|
||||
"r_rows": 4,
|
||||
"cost": "REPLACED",
|
||||
"r_table_time_ms": "REPLACED",
|
||||
"r_other_time_ms": "REPLACED",
|
||||
"filtered": 100,
|
||||
|
Reference in New Issue
Block a user