Analysis of the underlying implementation principles of InnoDB and MyISAM indexes

Author: Zen and the Art of Computer Programming

1 Introduction

InnoDB is one of MySQL's default storage engines. It is a transactional, foreign key constrained, clustered index-organized data table that supports advanced features such as row-level locking. InnoDB uses a clustered index structure. Each table has a primary index, and data is accessed through the primary index. Secondly, InnoDB supports auxiliary indexes to improve query performance, and index data is stored in primary key order.

MyISAM is another widely used storage engine that supports advanced features such as full-text search, compression, and spatial functions. However, in the latest version of MySQL, support for MyISAM has been phased out, leaving only support for InnoDB.

This article will start from the perspective of the underlying implementation principles of InnoDB and MyISAM indexes, deeply understand some of the differences and similarities between them, and introduce some advantages and disadvantages of InnoDB index structure, including clustered index, auxiliary index, covering index, index maintenance, return Table queries, index invalidations, deadlocks and solutions. We will also deeply analyze the relationship between InnoDB and MyISAM indexes and further elaborate on related concepts. Finally, the author will introduce the method of collecting index selectivity statistics and the methodology of index-based query optimization. This knowledge will help readers better understand the working principles and applications of indexes.

The content of the article mainly includes the following 7 chapters:

  1. Concepts and differences between InnoDB and MyISAM indexes
  2. InnoDB index structure and principle
  3. MyISAM index structure and principle
  4. Clustered and auxiliary indexes for InnoDB indexes
  5. InnoDB index data structure and algorithm
  6. How MySQL maintains indexes
  7. How to collect index selectivity statistics
  8. Query optimization methodology using indexes
  9. Some other things to note

2. Explanation of basic concepts and terms

2.1 InnoDB index related terms and definitions

1) InnoDB index: Inn

Guess you like

Origin blog.csdn.net/universsky2015/article/details/132913975