|
I tested with:
- 10.3.14
- 10.3.17
- 10.3.18
- 10.3.34
- 10.3.36
- 10.3.37
- 10.3.37-6216a2dfa2faabf8abfd3099a6cd46b00cef4115
And all reported a blank result:
|
10.3.37-6216a2dfa2faabf8abfd3099a6cd46b00cef4115
|
$ podman exec -ti m3 mysql -u bob -pbob MDEV-20368 -e 'analyze format=JSON SELECT * FROM t1,t2,t3
|
|
WHERE t1.b=t2.b and
|
|
EXISTS (select 1 from t4 where t4.b=t1.b group by t4.c having t3.b=max(t4.a))
|
|
ORDER BY t2.a desc,t1.a desc\G'
|
*************************** 1. row ***************************
|
ANALYZE: {
|
"query_block": {
|
"select_id": 1,
|
"r_loops": 1,
|
"r_total_time_ms": 0.2292,
|
"filesort": {
|
"sort_key": "t2.a desc, t1.a desc",
|
"r_loops": 1,
|
"r_total_time_ms": 3.4e-4,
|
"r_used_priority_queue": false,
|
"r_output_rows": 0,
|
"r_buffer_size": "390",
|
"temporary_table": {
|
"table": {
|
"table_name": "t1",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 5,
|
"r_rows": 5,
|
"r_total_time_ms": 0.0121,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"block-nl-join": {
|
"table": {
|
"table_name": "t2",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 5,
|
"r_rows": 5,
|
"r_total_time_ms": 0.0021,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"buffer_type": "flat",
|
"buffer_size": "256Kb",
|
"join_type": "BNL",
|
"attached_condition": "t2.b = t1.b",
|
"r_filtered": 20
|
},
|
"block-nl-join": {
|
"table": {
|
"table_name": "t3",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 21,
|
"r_rows": 100,
|
"r_total_time_ms": 0.0198,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"buffer_type": "incremental",
|
"buffer_size": "256Kb",
|
"join_type": "BNL",
|
"attached_condition": "<in_optimizer>(1,exists(subquery#2))",
|
"r_filtered": 0
|
},
|
"subqueries": [
|
{
|
"expression_cache": {
|
"r_loops": 500,
|
"r_hit_ratio": 99,
|
"query_block": {
|
"select_id": 2,
|
"r_loops": 5,
|
"r_total_time_ms": 0.1044,
|
"having_condition": "t3.b = max(t4.a)",
|
"filesort": {
|
"sort_key": "t4.c",
|
"r_loops": 5,
|
"r_total_time_ms": 0.0039,
|
"r_used_priority_queue": false,
|
"r_output_rows": 0,
|
"r_buffer_size": "(varied across executions)",
|
"temporary_table": {
|
"table": {
|
"table_name": "t4",
|
"access_type": "ALL",
|
"r_loops": 5,
|
"rows": 1,
|
"r_rows": 100,
|
"r_total_time_ms": 0.0799,
|
"filtered": 100,
|
"r_filtered": 1,
|
"attached_condition": "t4.b = t1.b"
|
}
|
}
|
}
|
}
|
}
|
}
|
]
|
}
|
}
|
}
|
}
|
Weijun Huang do you have some non-default server setting contributing to your success my_print_defaults --mysqld?
Correct results on:
- 10.4.27
- 10.4.27-3e0fd5e8a72ec8c6d48153113fb2987c2b456d17
|
10.4.27
|
ANALYZE: {
|
"query_block": {
|
"select_id": 1,
|
"r_loops": 1,
|
"r_total_time_ms": 9.4341,
|
"filesort": {
|
"sort_key": "t2.a desc, t1.a desc",
|
"r_loops": 1,
|
"r_total_time_ms": 0.0038,
|
"r_used_priority_queue": false,
|
"r_output_rows": 5,
|
"r_buffer_size": "390",
|
"temporary_table": {
|
"table": {
|
"table_name": "t1",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 5,
|
"r_rows": 5,
|
"r_total_time_ms": 0.0128,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"block-nl-join": {
|
"table": {
|
"table_name": "t2",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 5,
|
"r_rows": 5,
|
"r_total_time_ms": 0.002,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"buffer_type": "flat",
|
"buffer_size": "119",
|
"join_type": "BNL",
|
"attached_condition": "t2.b = t1.b",
|
"r_filtered": 20
|
},
|
"block-nl-join": {
|
"table": {
|
"table_name": "t3",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 21,
|
"r_rows": 100,
|
"r_total_time_ms": 0.0213,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"buffer_type": "incremental",
|
"buffer_size": "388",
|
"join_type": "BNL",
|
"attached_condition": "<in_optimizer>(1,exists(subquery#2))",
|
"r_filtered": 1
|
},
|
"subqueries": [
|
{
|
"expression_cache": {
|
"state": "disabled",
|
"r_loops": 200,
|
"r_hit_ratio": 0,
|
"query_block": {
|
"select_id": 2,
|
"r_loops": 500,
|
"r_total_time_ms": 9.1701,
|
"having_condition": "t3.b = max(t4.a)",
|
"temporary_table": {
|
"table": {
|
"table_name": "t4",
|
"access_type": "ALL",
|
"r_loops": 500,
|
"rows": 1,
|
"r_rows": 100,
|
"r_total_time_ms": 7.9882,
|
"filtered": 100,
|
"r_filtered": 1,
|
"attached_condition": "t4.b = t1.b"
|
}
|
}
|
}
|
}
|
}
|
]
|
}
|
}
|
}
|
}
|
|