当前位置:网站首页>database engine
database engine
2022-06-27 20:01:00 【Invincible Dragon Warrior】
List of articles
MyISAM and InnoDB

Data is stored in different ways , A table should store the table structure , Table data , Table index .
myisam
myisam A watch has proxies_priv.frm .myd .myi, His data and index are stored separately ,
innodb
In addition to storing table structures , Its data and index are stored in a file (server_cost.ibd).frm. This is also innodb In the case of a storage engine , Even if you don't add a primary key to it , It will also automatically generate a primary key for you . and myisam Add primary key , Just to give you , Because the data and index are stored separately . Data belongs to data , The index belongs to the index .
myisam and innodb The difference between
MyISAM Unsupported transaction 、 Foreign keys are also not supported , The index adopts non clustered index , The advantage is the speed of access , There is no requirement for transaction integrity , With SELECT、INSERT Basically, the main application can use this storage engine to create tables .MyISAM The table is stored on disk as 3 File , The file name is the same as the table name , The extensions are :
.frm( Storage table definition )
.MYD(MYData, Store the data )
.MYI (MYIndex, Storage index )
InnoDB The storage engine provides with commit 、 Transaction security of rollback and crash recovery capability , Support auto grow Columns , Foreign key and other functions , The index adopts clustered index , The index and data are stored in the same file , therefore InnoDB Your table has two files on disk , The file name is the same as the table name , The extensions are :
.frm( Definition of storage table )
.ibd( Store data and index )
Why is it InnoDB, You create a table , No primary key added , It automatically adds a primary key to you ( An integer column ) Well ? Because data and index are stored together .
MEMORY The storage engine uses what is in memory to create tables . Every MEMORY Table only corresponds to one disk file , The format is .frm( Table structure definition ).MEMORY Type of table access is very fast , Because its data is in memory , And by default HASH Indexes ( Not suitable for range query ), But once the service is shut down , The data in the table will be lost .
Differences between storage engines
a key : Indexes , Locking mechanism , Business 
Locking mechanism : Indicates that when the database is accessed by concurrent requests , When multiple transactions operate , Granularity of concurrent operations .
B- Tree index and Hashi index : Mainly to accelerate SQL Query speed of .
Foreign keys : The fields of the child table depend on the primary key of the parent table , Set the dependency between the two tables .
Business : Multiple SQL sentence , Ensure that they perform atomic operations together , Or success , Or failure , You can't succeed only partially , Failure requires rollback of the transaction .
Index cache and data cache : and MySQL Server Query cache related , Before modifying the data and index , Repeated queries can be performed without disk I/O( Improve the performance of the database , The purpose is to reduce disk I/O Operation to improve database access efficiency ), Just read the cache of the last query in memory .
边栏推荐
猜你喜欢

Solution of adding st-link to Huada MCU Keil

Accumulating power in the middle stage, UFIDA IUAP builds a new base for digital intelligence of social enterprises

Observable, reliable: the first shot of cloudops series Salon of cloud automation operation and maintenance

数智化进入“深水区”,数据治理是关键

拥抱云原生:江苏移动订单中心实践

嵌入式软件开发中必备软件工具

海底电缆探测技术总结

Oracle 获取月初、月末时间,获取上一月月初、月末时间

Bit.Store:熊市漫漫,稳定Staking产品或成主旋律
![[login interface]](/img/72/d527a5de23aa9da108e405eb6bb39c.png)
[login interface]
随机推荐
Hanoi Tower problem
Hanoi塔问题
作用域-Number和String的常用Api(方法)
从指令交读掌握函数调用堆栈详细过程
GIS遥感R语言学习看这里
Error reported by Huada MCU Keil_ Weak's solution
回溯相关问题
華大單片機KEIL報錯_WEAK的解决方案
PyCharm常用功能 - 断点调试
数仓的字符截取三胞胎:substrb、substr、substring
运算符的基础知识
Manage rust project through cargo
ABAP随笔-通过api获取新冠数据
(LC)46. 全排列
Talk about graduation season
字典树(复习)
流程判断-三目运算-for循环
【云驻共创】 什么是信息化?什么是数字化?这两者有什么联系和区别?
多伦多大学博士论文 | 深度学习中的训练效率和鲁棒性
Redis集群