Skip to content

Commit 96d1a57

Browse files
spetruniamontywi
authored andcommitted
MDEV-30032: EXPLAIN FORMAT=JSON output: part #2: print 'loops'.
1 parent 5f851f3 commit 96d1a57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1635
-2
lines changed

mysql-test/main/analyze_format_json.result

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ ANALYZE
1818
"table": {
1919
"table_name": "t0",
2020
"access_type": "ALL",
21+
"loops": 1,
2122
"r_loops": 1,
2223
"rows": 10,
2324
"r_rows": 10,
@@ -56,6 +57,7 @@ ANALYZE
5657
"table": {
5758
"table_name": "t0",
5859
"access_type": "ALL",
60+
"loops": 1,
5961
"r_loops": 1,
6062
"rows": 10,
6163
"r_rows": 10,
@@ -76,6 +78,7 @@ ANALYZE
7678
"key_length": "5",
7779
"used_key_parts": ["a"],
7880
"ref": ["test.t0.a"],
81+
"loops": 10,
7982
"r_loops": 0,
8083
"rows": 1,
8184
"r_rows": null,
@@ -109,6 +112,7 @@ ANALYZE
109112
"table": {
110113
"table_name": "t0",
111114
"access_type": "ALL",
115+
"loops": 1,
112116
"r_loops": 1,
113117
"rows": 10,
114118
"r_rows": 10,
@@ -129,6 +133,7 @@ ANALYZE
129133
"key_length": "5",
130134
"used_key_parts": ["a"],
131135
"ref": ["test.t0.a"],
136+
"loops": 10,
132137
"r_loops": 10,
133138
"rows": 1,
134139
"r_rows": 1,
@@ -165,6 +170,7 @@ ANALYZE
165170
"table": {
166171
"table_name": "tbl1",
167172
"access_type": "ALL",
173+
"loops": 1,
168174
"r_loops": 1,
169175
"rows": 100,
170176
"r_rows": 100,
@@ -181,6 +187,7 @@ ANALYZE
181187
"table": {
182188
"table_name": "tbl2",
183189
"access_type": "ALL",
190+
"loops": 100,
184191
"r_loops": 1,
185192
"rows": 100,
186193
"r_rows": 100,
@@ -218,6 +225,7 @@ ANALYZE
218225
"table": {
219226
"table_name": "tbl1",
220227
"access_type": "ALL",
228+
"loops": 1,
221229
"r_loops": 1,
222230
"rows": 100,
223231
"r_rows": 100,
@@ -234,6 +242,7 @@ ANALYZE
234242
"table": {
235243
"table_name": "tbl2",
236244
"access_type": "ALL",
245+
"loops": 100,
237246
"r_loops": 1,
238247
"rows": 100,
239248
"r_rows": 100,
@@ -280,6 +289,7 @@ ANALYZE
280289
"table": {
281290
"table_name": "t1",
282291
"access_type": "ALL",
292+
"loops": 1,
283293
"r_loops": 1,
284294
"rows": 10,
285295
"r_rows": 10,
@@ -300,6 +310,7 @@ ANALYZE
300310
"key_length": "5",
301311
"used_key_parts": ["a"],
302312
"ref": ["test.t1.a"],
313+
"loops": 10,
303314
"r_loops": 10,
304315
"rows": 2,
305316
"r_rows": 0.2,
@@ -344,6 +355,7 @@ ANALYZE
344355
"table": {
345356
"table_name": "t1",
346357
"access_type": "ALL",
358+
"loops": 1,
347359
"r_loops": 1,
348360
"rows": 10,
349361
"r_rows": 10,
@@ -414,6 +426,7 @@ ANALYZE
414426
"key": "PRIMARY",
415427
"key_length": "4",
416428
"used_key_parts": ["pk"],
429+
"loops": 1,
417430
"r_loops": 1,
418431
"rows": 10,
419432
"r_rows": 10,
@@ -492,6 +505,7 @@ ANALYZE
492505
"table": {
493506
"table_name": "t1",
494507
"access_type": "ALL",
508+
"loops": 1,
495509
"r_loops": 1,
496510
"rows": 5,
497511
"r_rows": 5,
@@ -519,6 +533,7 @@ ANALYZE
519533
"table_name": "t2",
520534
"access_type": "ALL",
521535
"possible_keys": ["key1", "key2", "key3", "key4"],
536+
"loops": 5,
522537
"r_loops": 5,
523538
"rows": 1010,
524539
"r_rows": 203.8,
@@ -565,6 +580,7 @@ ANALYZE
565580
"table": {
566581
"table_name": "tbl1",
567582
"access_type": "ALL",
583+
"loops": 1,
568584
"r_loops": 1,
569585
"rows": 10,
570586
"r_rows": 10,
@@ -591,6 +607,7 @@ ANALYZE
591607
"table": {
592608
"table_name": "tbl2",
593609
"access_type": "ALL",
610+
"loops": 1,
594611
"r_loops": 1,
595612
"rows": 10,
596613
"r_rows": 10,
@@ -650,6 +667,7 @@ ANALYZE
650667
"table": {
651668
"table_name": "t2",
652669
"access_type": "ALL",
670+
"loops": 1,
653671
"r_loops": 1,
654672
"rows": 256,
655673
"r_rows": 256,
@@ -691,6 +709,7 @@ ANALYZE
691709
"table": {
692710
"table_name": "t2",
693711
"access_type": "ALL",
712+
"loops": 1,
694713
"r_loops": 1,
695714
"rows": 256,
696715
"r_rows": 256,
@@ -746,6 +765,7 @@ ANALYZE
746765
"table": {
747766
"table_name": "t2",
748767
"access_type": "ALL",
768+
"loops": 1,
749769
"r_loops": 1,
750770
"rows": 256,
751771
"r_rows": 256,
@@ -785,6 +805,7 @@ ANALYZE
785805
"table": {
786806
"table_name": "t1",
787807
"access_type": "ALL",
808+
"loops": 1,
788809
"r_loops": 1,
789810
"rows": 2,
790811
"r_rows": 2,
@@ -800,6 +821,7 @@ ANALYZE
800821
"table": {
801822
"table_name": "t2",
802823
"access_type": "ALL",
824+
"loops": 2,
803825
"r_loops": 1,
804826
"rows": 2,
805827
"r_rows": 2,
@@ -831,6 +853,7 @@ ANALYZE
831853
"table": {
832854
"table_name": "t1",
833855
"access_type": "ALL",
856+
"loops": 1,
834857
"r_loops": 1,
835858
"rows": 2,
836859
"r_rows": 2,
@@ -897,6 +920,7 @@ ANALYZE
897920
"table": {
898921
"table_name": "t2",
899922
"access_type": "ALL",
923+
"loops": 1,
900924
"r_loops": 1,
901925
"rows": 2,
902926
"r_rows": 2,
@@ -912,6 +936,7 @@ ANALYZE
912936
"table": {
913937
"table_name": "t3",
914938
"access_type": "ALL",
939+
"loops": 2,
915940
"r_loops": 1,
916941
"rows": 2,
917942
"r_rows": 2,
@@ -943,6 +968,7 @@ ANALYZE
943968
"table": {
944969
"table_name": "t1",
945970
"access_type": "ALL",
971+
"loops": 1,
946972
"r_loops": 0,
947973
"rows": 2,
948974
"r_rows": null,
@@ -956,6 +982,7 @@ ANALYZE
956982
"table": {
957983
"table_name": "t2",
958984
"access_type": "ALL",
985+
"loops": 2,
959986
"r_loops": 0,
960987
"rows": 2,
961988
"r_rows": null,
@@ -1007,6 +1034,7 @@ ANALYZE
10071034
"table": {
10081035
"table_name": "t1",
10091036
"access_type": "ALL",
1037+
"loops": 1,
10101038
"r_loops": 1,
10111039
"rows": 10,
10121040
"r_rows": 10,
@@ -1041,6 +1069,7 @@ ANALYZE
10411069
"table": {
10421070
"table_name": "t2",
10431071
"access_type": "ALL",
1072+
"loops": 1,
10441073
"r_loops": 0,
10451074
"rows": 10,
10461075
"r_rows": null,

mysql-test/main/analyze_stmt_orderby.result

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ EXPLAIN
191191
"table": {
192192
"table_name": "t0",
193193
"access_type": "ALL",
194+
"loops": 1,
194195
"rows": 10,
195196
"cost": "COST_REPLACED",
196197
"filtered": 100,
@@ -206,6 +207,7 @@ EXPLAIN
206207
"key_length": "5",
207208
"used_key_parts": ["a"],
208209
"ref": ["test.t0.a"],
210+
"loops": 10,
209211
"rows": 1,
210212
"cost": "COST_REPLACED",
211213
"filtered": 100
@@ -242,6 +244,7 @@ ANALYZE
242244
"table": {
243245
"table_name": "t0",
244246
"access_type": "ALL",
247+
"loops": 1,
245248
"r_loops": 1,
246249
"rows": 10,
247250
"r_rows": 10,
@@ -262,6 +265,7 @@ ANALYZE
262265
"key_length": "5",
263266
"used_key_parts": ["a"],
264267
"ref": ["test.t0.a"],
268+
"loops": 10,
265269
"r_loops": 10,
266270
"rows": 1,
267271
"r_rows": 0.4,
@@ -300,6 +304,7 @@ EXPLAIN
300304
"table": {
301305
"table_name": "t0",
302306
"access_type": "ALL",
307+
"loops": 1,
303308
"rows": 10,
304309
"cost": "COST_REPLACED",
305310
"filtered": 100,
@@ -317,6 +322,7 @@ EXPLAIN
317322
"key_length": "5",
318323
"used_key_parts": ["a"],
319324
"ref": ["test.t0.a"],
325+
"loops": 10,
320326
"rows": 1,
321327
"cost": "COST_REPLACED",
322328
"filtered": 100
@@ -352,6 +358,7 @@ ANALYZE
352358
"table": {
353359
"table_name": "t0",
354360
"access_type": "ALL",
361+
"loops": 1,
355362
"r_loops": 1,
356363
"rows": 10,
357364
"r_rows": 10,
@@ -374,6 +381,7 @@ ANALYZE
374381
"key_length": "5",
375382
"used_key_parts": ["a"],
376383
"ref": ["test.t0.a"],
384+
"loops": 10,
377385
"r_loops": 10,
378386
"rows": 1,
379387
"r_rows": 0.4,
@@ -425,6 +433,7 @@ ANALYZE
425433
"table": {
426434
"table_name": "t2",
427435
"access_type": "ALL",
436+
"loops": 1,
428437
"r_loops": 1,
429438
"rows": 1000,
430439
"r_rows": 1000,
@@ -483,6 +492,7 @@ ANALYZE
483492
"table": {
484493
"table_name": "t0",
485494
"access_type": "ALL",
495+
"loops": 1,
486496
"r_loops": 1,
487497
"rows": 10,
488498
"r_rows": 10,
@@ -498,6 +508,7 @@ ANALYZE
498508
"table": {
499509
"table_name": "t3",
500510
"access_type": "ALL",
511+
"loops": 10,
501512
"r_loops": 1,
502513
"rows": 10,
503514
"r_rows": 10,
@@ -570,6 +581,7 @@ ANALYZE
570581
"table": {
571582
"table_name": "t6",
572583
"access_type": "ALL",
584+
"loops": 1,
573585
"r_loops": 1,
574586
"rows": 5,
575587
"r_rows": 5,
@@ -586,6 +598,7 @@ ANALYZE
586598
"table": {
587599
"table_name": "t5",
588600
"access_type": "ALL",
601+
"loops": 5,
589602
"r_loops": 1,
590603
"rows": 7,
591604
"r_rows": 7,
@@ -630,6 +643,7 @@ EXPLAIN
630643
"table": {
631644
"table_name": "t6",
632645
"access_type": "ALL",
646+
"loops": 1,
633647
"rows": 5,
634648
"cost": "COST_REPLACED",
635649
"filtered": 100,
@@ -641,6 +655,7 @@ EXPLAIN
641655
"table": {
642656
"table_name": "t5",
643657
"access_type": "ALL",
658+
"loops": 5,
644659
"rows": 7,
645660
"cost": "COST_REPLACED",
646661
"filtered": 100
@@ -700,6 +715,7 @@ ANALYZE
700715
"key": "idx",
701716
"key_length": "5",
702717
"used_key_parts": ["col1"],
718+
"loops": 1,
703719
"r_loops": 1,
704720
"rows": 7,
705721
"r_rows": 20,

0 commit comments

Comments
 (0)