当前位置:网站首页>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 .
边栏推荐
- Connection integration development theme month | drivers of enterprise master data governance
- Common shell script commands (4)
- UE4 realizes long press function
- (LC)46. 全排列
- 429- binary tree (108. convert the ordered array into a binary search tree, 538. convert the binary search tree into an accumulation tree, 106. construct a binary tree from the middle order and post o
- Kotlin微信支付回调后界面卡死并抛出UIPageFragmentActivity WindowLeaked
- 二叉树相关问题2
- UE4-Actor基础知识
- Batch insert data using MySQL bulkloader
- Web APls 阶段——第十四节——本地存储
猜你喜欢

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

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

Doctoral Dissertation of the University of Toronto - training efficiency and robustness in deep learning

MySQL初学者福利

数据库事务

《第五项修炼》(The Fifth Discipline):学习型组织的艺术与实践

Crontab's learning essays

Adding, deleting, modifying and querying MySQL tables (basic)

Redis持久化

UE4实现长按功能
随机推荐
Summary of submarine cable detection technology
What is ssr/ssg/isr? How do I host them on AWS?
流程判断-三目运算-for循环
DCC888 :Register Allocation
Rust advanced ownership - memory management
SQL Server - window function - solve the problem of filtering consecutive n records
多伦多大学博士论文 | 深度学习中的训练效率和鲁棒性
Bit. Store: long bear market, stable stacking products may become the main theme
MySQL初学者福利
数组练习 后续补充
Cdga | what is the core of digital transformation in the transportation industry?
循环遍历及函数基础知识
Redis持久化
Web APls 阶段——第十四节——本地存储
蓄力中台,用友iuap筑牢社会级企业数智化新底座
1024 Palindromic Number
429- binary tree (108. convert the ordered array into a binary search tree, 538. convert the binary search tree into an accumulation tree, 106. construct a binary tree from the middle order and post o
Mathematical derivation from perceptron to feedforward neural network
Hanoi塔问题
Is it safe to buy stocks and open an account on the account opening link of the securities manager? Ask the great God for help