Book Image

Building a Web Application with PHP and MariaDB: A Reference Guide

By : Sai S Sriparasa
Book Image

Building a Web Application with PHP and MariaDB: A Reference Guide

By: Sai S Sriparasa

Overview of this book

Table of Contents (17 chapters)
Building a Web Application with PHP and MariaDB: A Reference Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Performance optimization for MariaDB


In this section, we will be going over the different steps for optimizing MariaDB. MariaDB already arrives with powerful algorithms that are used internally for performance optimization. Although the storage engines are optimized to run queries, we as developers should be aware of a few best practices that will help us build better queries. A few optimization techniques that we will be discussing in this section are:

  • Best practices for data retrieval

  • Understanding query execution

  • Query optimization and indexes

Best practices for data retrieval

In a read-heavy environment, data retrieval will probably be the most common operation. Data retrieval, if not done correctly, can be a very processing-intensive process. It is always recommended to filter the data that is being retrieved in order to reduce the amount of processing that has to be done. The best practices that will be discussed more for data retrieval are as follows:

  • It is recommended to avoid retrieving...