gpt4 book ai didi

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

转载 作者:IT老高 更新时间:2023-10-29 00:09:03 25 4
gpt4 key购买 nike

我对散布伤害的 here 感到很困惑.

我知道怎么做,见下文,但不知道为什么?它们是干什么用的?

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));

最佳答案

InnoDB 是一个 storage engine in MySQL .它们有很多,它们各有利弊。 InnoDB 的最大优势是:

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

关于mysql - 什么时候应该选择在 MySQL 中使用 InnoDB?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1082194/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com