Database -> Briefly describe the difference between MyISAM and InnoDB

Briefly describe the difference between MyISAM and InnoDB

MyISAM:

  • Transactions are not supported , but each query is atomic;
  • Supports table-level locks , that is, each operation locks the entire table ;
  • A MYISAM table has three files: index file, table structure file, and data file ;
  • A non-clustered index is used to store the data domain of the index file 指向数据⽂件的指针.

InnoDb:

  • Supports ACID transactions , supports four isolation levels of transactions ;

  • Supports row-level locks and foreign key constraints : so it can support write concurrency ;

  • An InnoDb engine is stored in a file space

    • (Shared table space, the size of the table is not controlled by the operating system, a table may be distributed in multiple files)
  • It is also possible for multiple

    • (Set it as an independent table empty, the table size is limited by the size of the operating system file, generally 2G), limited by the size of the operating system file;
  • The primary key index adopts a clustered index (the data field of the index stores the data file itself), and the data field of the secondary index stores the value of the primary key ;

  • Therefore , you need to find the primary key value辅索引查找数据 through the auxiliary index first , and then access the clustered index ;

  • It is best to use an auto-incrementing primary key to prevent large adjustments to the file in order to maintain the B+ tree structure when inserting data.

Guess you like

Origin blog.csdn.net/rod0320/article/details/123515587