Skip to content

Commit

Permalink
MDEV-30032: EXPLAIN FORMAT=JSON output: part #2: print 'loops'.
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrunia committed Feb 3, 2023
1 parent ffe0bec commit 6c4076f
Show file tree
Hide file tree
Showing 51 changed files with 1,641 additions and 4 deletions.
29 changes: 29 additions & 0 deletions mysql-test/main/analyze_format_json.result
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand Down Expand Up @@ -56,6 +57,7 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand All @@ -76,6 +78,7 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"loops": 10,
"r_loops": 0,
"rows": 1,
"r_rows": null,
Expand Down Expand Up @@ -109,6 +112,7 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand All @@ -129,6 +133,7 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"loops": 10,
"r_loops": 10,
"rows": 1,
"r_rows": 1,
Expand Down Expand Up @@ -165,6 +170,7 @@ ANALYZE
"table": {
"table_name": "tbl1",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 100,
"r_rows": 100,
Expand All @@ -181,6 +187,7 @@ ANALYZE
"table": {
"table_name": "tbl2",
"access_type": "ALL",
"loops": 100,
"r_loops": 1,
"rows": 100,
"r_rows": 100,
Expand Down Expand Up @@ -218,6 +225,7 @@ ANALYZE
"table": {
"table_name": "tbl1",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 100,
"r_rows": 100,
Expand All @@ -234,6 +242,7 @@ ANALYZE
"table": {
"table_name": "tbl2",
"access_type": "ALL",
"loops": 100,
"r_loops": 1,
"rows": 100,
"r_rows": 100,
Expand Down Expand Up @@ -280,6 +289,7 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand All @@ -300,6 +310,7 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
"loops": 10,
"r_loops": 10,
"rows": 2,
"r_rows": 0.2,
Expand Down Expand Up @@ -344,6 +355,7 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand Down Expand Up @@ -414,6 +426,7 @@ ANALYZE
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["pk"],
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand Down Expand Up @@ -492,6 +505,7 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 5,
"r_rows": 5,
Expand Down Expand Up @@ -519,6 +533,7 @@ ANALYZE
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["key1", "key2", "key3", "key4"],
"loops": 5,
"r_loops": 5,
"rows": 1010,
"r_rows": 203.8,
Expand Down Expand Up @@ -565,6 +580,7 @@ ANALYZE
"table": {
"table_name": "tbl1",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand All @@ -591,6 +607,7 @@ ANALYZE
"table": {
"table_name": "tbl2",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand Down Expand Up @@ -650,6 +667,7 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 256,
"r_rows": 256,
Expand Down Expand Up @@ -691,6 +709,7 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 256,
"r_rows": 256,
Expand Down Expand Up @@ -746,6 +765,7 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 256,
"r_rows": 256,
Expand Down Expand Up @@ -785,6 +805,7 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
Expand All @@ -800,6 +821,7 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
"loops": 2,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
Expand Down Expand Up @@ -831,6 +853,7 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
Expand Down Expand Up @@ -897,6 +920,7 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
Expand All @@ -912,6 +936,7 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
"loops": 2,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
Expand Down Expand Up @@ -943,6 +968,7 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
"loops": 1,
"r_loops": 0,
"rows": 2,
"r_rows": null,
Expand All @@ -956,6 +982,7 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
"loops": 2,
"r_loops": 0,
"rows": 2,
"r_rows": null,
Expand Down Expand Up @@ -1007,6 +1034,7 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand Down Expand Up @@ -1041,6 +1069,7 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
"loops": 1,
"r_loops": 0,
"rows": 10,
"r_rows": null,
Expand Down
16 changes: 16 additions & 0 deletions mysql-test/main/analyze_stmt_orderby.result
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ EXPLAIN
"table": {
"table_name": "t0",
"access_type": "ALL",
"loops": 1,
"rows": 10,
"cost": "COST_REPLACED",
"filtered": 100,
Expand All @@ -206,6 +207,7 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"loops": 10,
"rows": 1,
"cost": "COST_REPLACED",
"filtered": 100
Expand Down Expand Up @@ -242,6 +244,7 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand All @@ -262,6 +265,7 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"loops": 10,
"r_loops": 10,
"rows": 1,
"r_rows": 0.4,
Expand Down Expand Up @@ -300,6 +304,7 @@ EXPLAIN
"table": {
"table_name": "t0",
"access_type": "ALL",
"loops": 1,
"rows": 10,
"cost": "COST_REPLACED",
"filtered": 100,
Expand All @@ -317,6 +322,7 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"loops": 10,
"rows": 1,
"cost": "COST_REPLACED",
"filtered": 100
Expand Down Expand Up @@ -352,6 +358,7 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand All @@ -374,6 +381,7 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
"loops": 10,
"r_loops": 10,
"rows": 1,
"r_rows": 0.4,
Expand Down Expand Up @@ -425,6 +433,7 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
Expand Down Expand Up @@ -483,6 +492,7 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand All @@ -498,6 +508,7 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
"loops": 10,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
Expand Down Expand Up @@ -570,6 +581,7 @@ ANALYZE
"table": {
"table_name": "t6",
"access_type": "ALL",
"loops": 1,
"r_loops": 1,
"rows": 5,
"r_rows": 5,
Expand All @@ -586,6 +598,7 @@ ANALYZE
"table": {
"table_name": "t5",
"access_type": "ALL",
"loops": 5,
"r_loops": 1,
"rows": 7,
"r_rows": 7,
Expand Down Expand Up @@ -630,6 +643,7 @@ EXPLAIN
"table": {
"table_name": "t6",
"access_type": "ALL",
"loops": 1,
"rows": 5,
"cost": "COST_REPLACED",
"filtered": 100,
Expand All @@ -641,6 +655,7 @@ EXPLAIN
"table": {
"table_name": "t5",
"access_type": "ALL",
"loops": 5,
"rows": 7,
"cost": "COST_REPLACED",
"filtered": 100
Expand Down Expand Up @@ -700,6 +715,7 @@ ANALYZE
"key": "idx",
"key_length": "5",
"used_key_parts": ["col1"],
"loops": 1,
"r_loops": 1,
"rows": 7,
"r_rows": 20,
Expand Down
Loading

0 comments on commit 6c4076f

Please sign in to comment.