Explain Analyze extensions in MySQL 8.0.18 version

In the previous version, we use explain SQL command to see the specific implementation plan. In the new version of MySQL 8.0.18 expand explain, one is explain format = tree, and the other is based explain format = tree extending extension Explain Analyze, today we look at how the command is executed.


Or do the testing sbtest1 table.

explain analyze select count(*) from sbtest1;

1.png

This result is very curious, where without conditions, and consequently can not show up, looks like a BUG?


Too, add where id> 0 and try again.

explain analyze select count(*) from sbtest1 where id>0;

2.png

Note the red underlined parts within it will run the query and measure the execution time.


Meaning explain:

1) rows cost part = 4,936,262, and the results are consistent explain generation, estimating the number of lines are read.

3.png


2) Actual rows part = 10000000, the real results of this execution is returned by SQL, see as shown below

4.png


3) actual time = 62004.565 (in ms milliseconds), this is converted into a second SQL execution time is 62 seconds, but in fact there is a great error, you see above

The execution time of 7.98 seconds, it is rounded to 8 seconds, 62/8 about the error reached about 77%, so we can not really believe these numbers.



Guess you like

Origin blog.51cto.com/hcymysql/2447890