MySQL database engine in two

MySQL database can choose to have multiple database engines, here focuses on MyISAM and InnoDB

1、MyISAM

  (1) MyISAM is the default MySQL before version 5.5 database engine, is in the early ISAM (Indexed Sequential Access Method: sequential access method index) based on the improvement obtained.

  (2) Features:

    Advantages: excellent performance, a full-text indexing, compression, spatial functions and other functions

    Disadvantages: does not support transactions and row-level locking, the biggest problem is that the database can not be restored after crash

 

2、InnoDB

  (1) InnoDB is a MySQL version 5.5 after the default database engine, compared with ISAM and MyISAM, the biggest advantage and benefit is to increase the database transaction functionality.

  (2) Features:

    Pros: Support Services and row-level locking, support for recovery after a database crash

    Disadvantages: does not support full-text indexing

 

3, comparison of two database engine

  (1) supported lock granularity: MyISAM support table lock, does not support the row-level locks. InnoDB supports row-level locking, it is possible to provide higher concurrency.

  (2) whether to support the transaction: MyISAM does not support transactions, InnoDB support transactional operations

  Whether recoverable after (3) database crash: MyISAM unrecoverable, while InnoDB database can be restored after a crash.

  (4) whether to support foreign keys: MyISAM does not support foreign keys, and support for InnoDB foreign keys.

  (5) whether to support full-text indexing: MyISAM supports full-text indexing, so performance is better; but InnoDB does not support full-text indexing.

 

4, added: row-level locking and table-level locking

  Row-level locking:

     Lock the row of data for each operation. Large overhead, locking slow; there will be a deadlock; locking the smallest size, lowest probability of lock conflicts, but also the highest degree of concurrency;

  Table-level locking: 

    Each operation to lock an entire table. Overhead small, locked fast; not deadlock; lock large size, the probability of lock conflicts of the highest, lowest degree of concurrency;

   

Guess you like

Origin www.cnblogs.com/xwwbb/p/11084699.html