Mysql – Can select read index page while modify this page in innodb

innodbMySQL

When mysql innodb insert or update secondary index page , will at the same time this index page can searched by select ?

Best Answer

Yes, that's possible, that's what the change buffer is for. It caches changes to secondary indexes. When data is read via an index and (parts of) the index is in the change buffer, it's read from there. The changes are written to disk periodically.

The change buffer is a special data structure that caches changes to secondary index pages when affected pages are not in the buffer pool. The buffered changes, which may result from INSERT, UPDATE, or DELETE operations (DML), are merged later when the pages are loaded into the buffer pool by other read operations.
...
Periodically, the purge operation that runs when the system is mostly idle, or during a slow shutdown, writes the updated index pages to disk.

Read about it in more detail here.

Also creating/dropping/changing an index is possible while selects/insert/updates/deletes can be performed at the same time with online DDL (at least with MySQL >= 5.6).

Read more about it here.