The execution plan

We will begin understanding the execution plan by analyzing simple WHERE clauses. To do so, we will use our first Linux for PHP Docker container. In the first chapter, we loaded the Sakila database into the MariaDB (MySQL) server. We will now use it to learn how an execution plan works and when to use query optimization techniques. Once on the container's CLI, enter the following commands:

# mysql -uroot 
# MariaDB > USE sakila; 
# MariaDB > SELECT * FROM actor WHERE first_name = 'AL'; 

These commands should yield the following results:

The result of the SELECT statement

At first glance, this query seems to be fine with an ...

Get Mastering The Faster Web with PHP, MySQL, and JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.