mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-28926 Add time spent on query optimizer to JSON ANALYZE (#2193)
* Add query optimizer timer to ANALYZE FORMAT=JSON * Adapt tests and results * Change logic to always close the writer after printing query blocks
This commit is contained in:
committed by
Sergei Petrunia
parent
f45f60636f
commit
ad7631bdce
@ -1148,6 +1148,9 @@ EXPLAIN
|
||||
analyze format=json select count(distinct b) from t1 group by a;
|
||||
ANALYZE
|
||||
{
|
||||
"query_optimization": {
|
||||
"r_total_time_ms": "REPLACED"
|
||||
},
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"r_loops": 1,
|
||||
@ -1446,6 +1449,9 @@ analyze format=json
|
||||
select * from t1;
|
||||
ANALYZE
|
||||
{
|
||||
"query_optimization": {
|
||||
"r_total_time_ms": "REPLACED"
|
||||
},
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"table": {
|
||||
@ -1497,6 +1503,9 @@ analyze format=json
|
||||
select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
|
||||
ANALYZE
|
||||
{
|
||||
"query_optimization": {
|
||||
"r_total_time_ms": "REPLACED"
|
||||
},
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"r_loops": 1,
|
||||
@ -1576,6 +1585,9 @@ analyze format=json
|
||||
select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
|
||||
ANALYZE
|
||||
{
|
||||
"query_optimization": {
|
||||
"r_total_time_ms": "REPLACED"
|
||||
},
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"r_loops": 1,
|
||||
@ -1664,6 +1676,9 @@ analyze format=json
|
||||
select distinct t1.a from t1 join t2 on t2.pk=t1.a;
|
||||
ANALYZE
|
||||
{
|
||||
"query_optimization": {
|
||||
"r_total_time_ms": "REPLACED"
|
||||
},
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"r_loops": 1,
|
||||
@ -1770,6 +1785,9 @@ analyze format=json
|
||||
select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
|
||||
ANALYZE
|
||||
{
|
||||
"query_optimization": {
|
||||
"r_total_time_ms": "REPLACED"
|
||||
},
|
||||
"query_block": {
|
||||
"select_id": 1,
|
||||
"r_loops": 1,
|
||||
|
Reference in New Issue
Block a user