diff --git a/mysql-test/main/rowid_filter.result b/mysql-test/main/rowid_filter.result index 1a755e86c74..b544c784c25 100644 --- a/mysql-test/main/rowid_filter.result +++ b/mysql-test/main/rowid_filter.result @@ -592,6 +592,7 @@ ANALYZE "ref": ["dbt3_s001.lineitem.l_orderkey"], "loops": 98, "r_loops": 98, + "r_table_loops": 96, "rows": 1, "r_rows": 1, "cost": "REPLACED", diff --git a/mysql-test/main/rowid_filter_aria.result b/mysql-test/main/rowid_filter_aria.result index 6ddd2c0679f..b7a3a29ab9c 100644 --- a/mysql-test/main/rowid_filter_aria.result +++ b/mysql-test/main/rowid_filter_aria.result @@ -450,6 +450,7 @@ ANALYZE }, "loops": 92, "r_loops": 98, + "r_table_loops": 96, "rows": 1, "r_rows": 0.112244898, "cost": "REPLACED", @@ -593,6 +594,7 @@ ANALYZE "ref": ["dbt3_s001.lineitem.l_orderkey"], "loops": 92, "r_loops": 98, + "r_table_loops": 96, "rows": 1, "r_rows": 1, "cost": "REPLACED", @@ -765,6 +767,7 @@ ANALYZE "ref": ["dbt3_s001.lineitem.l_orderkey"], "loops": 56.90890924, "r_loops": 34, + "r_table_loops": 33, "rows": 1, "r_rows": 1, "cost": "REPLACED", @@ -915,6 +918,7 @@ ANALYZE "ref": ["dbt3_s001.lineitem.l_orderkey"], "loops": 56.90890924, "r_loops": 34, + "r_table_loops": 33, "rows": 1, "r_rows": 1, "cost": "REPLACED", diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result index 8210d0834cb..da6c848e334 100644 --- a/mysql-test/main/rowid_filter_innodb.result +++ b/mysql-test/main/rowid_filter_innodb.result @@ -433,6 +433,7 @@ ANALYZE "ref": ["dbt3_s001.lineitem.l_orderkey"], "loops": 98, "r_loops": 98, + "r_table_loops": 96, "rows": 1, "r_rows": 1, "cost": "REPLACED", @@ -578,6 +579,7 @@ ANALYZE "ref": ["dbt3_s001.lineitem.l_orderkey"], "loops": 98, "r_loops": 98, + "r_table_loops": 96, "rows": 1, "r_rows": 1, "cost": "REPLACED", diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index 5cfe3082b35..e98728eb443 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -1922,7 +1922,15 @@ void Explain_table_access::print_explain_json(Explain_query *query, /* r_loops (not present in tabular output) */ 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` */