O'Reilly logo

Mastering MariaDB by Federico Razzoli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Optimizing Queries

This chapter explains the basics of how to improve the performance of the queries that are executed on a MariaDB server. First, the important tools required to find slow queries are described. Once we find such queries, we will need to find out why they are slow. Thus, a description of how MariaDB uses indexes follows. Then, we will discuss the EXPLAIN command, which shows how MariaDB executes a query. Contextually, we will also discuss the main execution strategy.

The topics covered in this chapter are:

  • The slow query log
  • The pt-query-digest command from Percona Toolkit
  • Indexes
  • Table statistics
  • The EXPLAIN statement
  • Important MariaDB optimizations

The slow query log

The slow query log (or simply slow log) stores SQL statements ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required