You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
p/mysql-chooes-storage-engine/
对于数据库这一块询问比较多的就是在 MySQL 中怎么去选择一种合适当前业务需求的存储引擎,而 MySQL 中支持的存储引擎又有很多种,那么 MySQL 中分别又有那些,怎么优雅的使用呢?\n划分引擎原因 在文件系统中,MySQL 将每个数据库(也可以称之为 schema )保存为数据目录下的一个子目录。创建表时,MySQL 会在数据库子目录下创建一个和表同名的 .frm 文件保存表的定义。例如创建一个名为 DebugTable 的表,MySQL 会在 DebugTable.frm 文件中保存该表的定义。\n因为 MySQL 使用文件系统的目录和文件来保存数据库和表的定义,大小写敏感性和具体的平台密切相关。在 Windows 系统中,大小写是不敏感的;而在类 Unix 系统中则是敏感的。不同的存储引擎保存数据和索引的方式是不同的,但表的定义则是在 MySQL 服务层wk统一处理的。\n查看支持引擎 想了解 MySQL 中支持的引擎的情况,可以使用如下命令查看:\n1 show engines; 结果如下(MySQL版本:Ver 8.0.19):\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 mysql> show engines; +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO | | MyISAM | YES | MyISAM storage engine | NO | NO | NO | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ 9 rows in set (0.00 sec) 存储引擎分类 MySQL 存储引擎分类有 MyISAM、InnoDB、Memory、Merge等,可以看上面表中列出的支持引擎,但是其中最为常用的就是 MyISAM 和 InnoDB 两个引擎,其中针对于以上讲到的存储引擎,如下表进行对比:\n
https://blog.debuginn.com/p/mysql-chooes-storage-engine/
Beta Was this translation helpful? Give feedback.
All reactions