First, the database engine
The database engine has three types: InnoDB, MyISAM, MEMORY. Wherein InnoDB, MyISAM most commonly used, the following differences:
InnoDB storage engine
1. Transaction Support
2. Support foreign keys
3. row-level locks
4. The recovery after a crash safety support
5. The primary key index with aggregation index (index data field stores data file itself), secondary index data stored in the primary key field value;
therefore look for data from secondary index, you need to find a primary key value through secondary index, and then access the primary key index;
MyISAM storage engine
1 does not support transactions, but the operation is atomic
2 does not support foreign key
3. table lock
4 does not support secure the crash recovery
5. The data field stores data points using a non-clustered index, the index file pointer file.
MEMORY
All data in memory, fast data processing speed, but security is not high.
Full-text indexing: indexing files, are the key words to search keywords quickly and do not have to search each data
clustered index: same order as the physical order of rows and columns of data values
non-clustered index: the physical order of data rows and columns different order values
Mysql present, there are several index types: FULLTEXT, HASH, BTREE, RTREE .
Mysql common index are: primary key index (primary key), a unique index (the index column value is not necessarily unique),
the general index, full-text indexing (keywords), the composite index (leftmost matching principle)
Second, why the database uses B + tree?
Because the data in the B + tree leaf node, non-leaf nodes only memory index
then when select multiple records, cross-layer can not access, can simply scan the leaf node