Commit 793caf3a authored by Monty's avatar Monty Committed by Sergei Petrunia

Added r_table_loops to "ANALYZE FORMAT=JSON statement"

Author: Sergei Petrunia <sergey@mariadb.com>
parent 3c1b7fb0
...@@ -592,6 +592,7 @@ ANALYZE ...@@ -592,6 +592,7 @@ ANALYZE
"ref": ["dbt3_s001.lineitem.l_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"],
"loops": 98, "loops": 98,
"r_loops": 98, "r_loops": 98,
"r_table_loops": 96,
"rows": 1, "rows": 1,
"r_rows": 1, "r_rows": 1,
"cost": "REPLACED", "cost": "REPLACED",
......
...@@ -450,6 +450,7 @@ ANALYZE ...@@ -450,6 +450,7 @@ ANALYZE
}, },
"loops": 92, "loops": 92,
"r_loops": 98, "r_loops": 98,
"r_table_loops": 96,
"rows": 1, "rows": 1,
"r_rows": 0.112244898, "r_rows": 0.112244898,
"cost": "REPLACED", "cost": "REPLACED",
...@@ -593,6 +594,7 @@ ANALYZE ...@@ -593,6 +594,7 @@ ANALYZE
"ref": ["dbt3_s001.lineitem.l_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"],
"loops": 92, "loops": 92,
"r_loops": 98, "r_loops": 98,
"r_table_loops": 96,
"rows": 1, "rows": 1,
"r_rows": 1, "r_rows": 1,
"cost": "REPLACED", "cost": "REPLACED",
...@@ -765,6 +767,7 @@ ANALYZE ...@@ -765,6 +767,7 @@ ANALYZE
"ref": ["dbt3_s001.lineitem.l_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"],
"loops": 56.90890924, "loops": 56.90890924,
"r_loops": 34, "r_loops": 34,
"r_table_loops": 33,
"rows": 1, "rows": 1,
"r_rows": 1, "r_rows": 1,
"cost": "REPLACED", "cost": "REPLACED",
...@@ -915,6 +918,7 @@ ANALYZE ...@@ -915,6 +918,7 @@ ANALYZE
"ref": ["dbt3_s001.lineitem.l_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"],
"loops": 56.90890924, "loops": 56.90890924,
"r_loops": 34, "r_loops": 34,
"r_table_loops": 33,
"rows": 1, "rows": 1,
"r_rows": 1, "r_rows": 1,
"cost": "REPLACED", "cost": "REPLACED",
......
...@@ -433,6 +433,7 @@ ANALYZE ...@@ -433,6 +433,7 @@ ANALYZE
"ref": ["dbt3_s001.lineitem.l_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"],
"loops": 98, "loops": 98,
"r_loops": 98, "r_loops": 98,
"r_table_loops": 96,
"rows": 1, "rows": 1,
"r_rows": 1, "r_rows": 1,
"cost": "REPLACED", "cost": "REPLACED",
...@@ -578,6 +579,7 @@ ANALYZE ...@@ -578,6 +579,7 @@ ANALYZE
"ref": ["dbt3_s001.lineitem.l_orderkey"], "ref": ["dbt3_s001.lineitem.l_orderkey"],
"loops": 98, "loops": 98,
"r_loops": 98, "r_loops": 98,
"r_table_loops": 96,
"rows": 1, "rows": 1,
"r_rows": 1, "r_rows": 1,
"cost": "REPLACED", "cost": "REPLACED",
......
...@@ -1922,7 +1922,15 @@ void Explain_table_access::print_explain_json(Explain_query *query, ...@@ -1922,7 +1922,15 @@ void Explain_table_access::print_explain_json(Explain_query *query,
/* r_loops (not present in tabular output) */ /* r_loops (not present in tabular output) */
if (is_analyze) if (is_analyze)
{ {
writer->add_member("r_loops").add_ll(tracker.get_loops()); ha_rows loops= tracker.get_loops();
writer->add_member("r_loops").add_ll(loops);
if (type == JT_EQ_REF) // max one row
{
ha_rows table_loops= op_tracker.get_loops();
if (table_loops != loops)
writer->add_member("r_table_loops").add_ll(table_loops);
}
} }
/* `rows` */ /* `rows` */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment