2. Engine Introduction

InnoDB

For transaction processing applications, support for foreign keys, and row-level locking. If the application for completeness things have relatively high requirements, data requirements under concurrent conditions consistency, data insertion and query operations in addition, also it includes many updates and deletes, then the InnoDB storage engine is more appropriate. In addition to effectively reduce the InnoDB caused by the lock deletes and updates can also ensure the integrity of the transaction commit and rollback for similar billing system or financial system for data accuracy requirements are relatively high system suitable choice.

MyISAM

If the application is read and insert operations-based, only a few of update and delete operations, and the integrity of the transaction, concurrency do not ask, you can choose the storage engine.

Memory

All data stored in memory, in the need to quickly locate records and other similar data environment, providing fast access. Memory drawback is that there are restrictions on the size of the table, although the database because of an abnormal termination, then data can be restored to normal, but once the database is shut down, the data will be stored in memory loss.

  • Data storage - storage engine engines
  • Use different storage engines, data stored in a different way
  • show engines; View storage engine
1.innodb 2 files
mysql5.6以上 默认的存储方式
并发 修改 删除操作的效率比较高
transaction 事务   保证数据安全 数据的完整性而设置的概念
row-level locking 行级锁  #当你修改的数据少时,适合用行级锁
table-level locking 表级锁
foreign keys 外键约束
树tree - 加速查询 (树形结构(数据+树) + 表结构)
2.myisam 3 files
    mysql5.5以下 默认的存储方式
    读 插入操作的效率高一些
    持久化存储 
    table-level locking 表级锁
    树tree - 加速查询 (树形结构 + 数据 + 表结构)
3.memory 1 file

Based on hash

Data stored in the memory level, power disappear

show create table staff;
create table myisam_t (id int,name char(18)) engine=myisam;
create table memory_t (id int,name char(18)) engine=memory;


两个表之间的关系

创建一个库
创建三张表 : myisam innodb memory
    向三张表中写数据
    重启server端
    重新登陆 查看你写进去的三条数据还在不在
就不在了

Guess you like

Origin www.cnblogs.com/pythonblogs/p/11313005.html
Recommended