什么时候应该选择在MySQL中使用InnoDB?

Léo*_* 준영 13 mysql innodb

我对这里的伤害感到困惑.

我知道怎么做,见下文,但不知道为什么?它们适用于什么?

create table orders (order_no int not null auto_increment, FK_cust_no int not null, 
foreign key(FK_cust_no) references customer(cust_no), primary key(order_no)) type=InnoDB;


create table orders (order_no int not null auto_increment, FK_cust_no int not null, 
foreign key(FK_cust_no) references customer(cust_no), primary key(order_no));
Run Code Online (Sandbox Code Playgroud)

Pat*_*and 18

InnoDB是MySQL中存储引擎.它们中有不少,它们各有利弊.InnoDB的最大优势是:

  • 支持交易(为您提供ACID属性的支持).
  • 行级锁定.与例如MyISAM相比,具有更细粒度的锁定机制可以提供更高的并发性.
  • 外键约束.允许您让数据库确保数据库状态的完整性以及表之间的关系.


Imr*_*ran 12

总是.除非您需要使用MySQL的全文搜索,否则在您的共享虚拟主机中禁用InnoDB.