I assume that anyone who has ever solved the problem of why a query takes so long in MySQL knows and uses the EXPLAIN command .
If not, in short, the EXPLAIN command, among other things, is used to show us how MySQL processes the query.
I will use the MySQL shell for a simple demonstration. I have a vyboh4 database with a database for my test WordPress, I have the prefix set to netwp_. The first SELECT that WordPress performs after connecting to the database is in this case:
SELECT option_name, option_value FROM netwp_options WHERE autoload = ‘yes’
Since the output is not very clear, we write the lines vertically:
We can see that everything is fine, MySQL will use the ‘autoload’ index. So we cancel the index and perform EXPLAIN again:
As you can see at first glance, the only difference is that no index was used, but the output was limited by WHERE. That didn’t tell us much about speed. EXPLAIN is a very useful tool, especially if you perform operations on multiple tables. Documentation for the EXPLAIN command output is available on the official website.
So why am I even writing this? The sweden phone number data answer is very simple. As of MySQL 8.0.18, MySQL has let us peek under the hood of the scheduler.
So let’s take a look at EXPLAIN ANALYZE , which will allow us to do this.
Same database, same query
Let’s start where we left off, we have a table without an index on the ‘autoload’ field.
We run EXPLAIN ANALYZE, add the ‘autoload’ index and run EXPLAIN ANALYZE again.
In the free version, you can choose in this type of ad from two layouts. You can also set the number of displayed posts ( Number of items ) and the number of columns ( Number of columns ). With the cg leads Padding around items option , you can set the offset of individual photos.