当前位置:网站首页>MySQL storage engine
MySQL storage engine
2022-07-06 00:22:00 【Constantly improving Nan】
MySQL Storage engine
1. What is a database storage engine ?
Database engine : It's for storage 、 Core services that process and protect data . With the database engine, you can control access and process transactions quickly , This meets the requirements of most applications within the enterprise that need to process large amounts of data .
2. The default storage engine is InnoDB
1. utilize show create table Table name sql Statement to see what the default storage engine is
3. Look at the storage engine for the database
sql sentence :show engines;
4. Create tables and develop storage engines for tables
1. Create a data table and set the table storage engine as MyISAM;
2. Create a data table and set the table storage engine as Memory;
5.InnoDB Storage engine
1.InnoDB What is it? ?
InnoDB It's a kind of balance High reliability and High performance universal storage engine .
2.InnoDB What are the characteristics of ?
1.DML( Data operation language : Additions and deletions ) Operation follows ACID( Four characteristics of transaction : Atomicity 、 Uniformity 、 Isolation, 、 persistence ) Model , Support transactions ;
2. Row-level locks , Improve concurrent access performance ;
3. Support foreign keys foreign key constraint , Ensure the integrity and correctness of data .
4. Support crash repair and auto increment .
3.InnoDB Analysis of advantages and disadvantages :
InnoDB The advantage of is to support transactions 、 Support foreign keys 、 Support crash repair and auto increment . adopt InnoDB To control transaction commit and rollback , So as to ensure the integrity of the business .
InnoDB The disadvantage of is the low efficiency of reading and writing , It takes up a lot of data space .
6. Database table level lock and row level lock
1.MySQL Lock mechanism of database : Different storage engines support different locking mechanisms .
MyISAM and MEMORY The storage engine uses table level locks .
InnoDB The storage engine supports row level locking , Table level locks are also supported , Row level lock is adopted by default .
2.MySQL Two main lock features :
Table lock : Lock the whole table every time , Low overhead , Locked fast , A deadlock will not occur , The probability of lock conflict is high , Low concurrency ;
Row-level locks : Lock a row of data each time , Spending big , Lock the slow , A deadlock occurs , The probability of lock conflict is low , High concurrency .
7.MyISAM
1.MyISAM Is early MySQL Early default storage engine .
characteristic :1. Unsupported transaction , Foreign key not supported ;
2. Support table lock , Row locks are not supported ;
3. Fast access
characteristic :
xxx.sdi: Store table structure information ;
xxx.MYD: Store the data ;
xxx.MYI: Storage index .
2.MyISAM Analysis of advantages and disadvantages :
MyISAM The engine saves a separate index file .myi, And its index is directly located to OFFSET Of , and InnoDB There is no separate physical index to store files ,InnoDB Index addressing is to locate the block data first , Then navigate to the row data , therefore ,MyISAM The query efficiency is better than InnoDB The query efficiency is high , But it doesn't support transactions , Foreign key not supported , The applicable scenario is to read more and write less , Business scenarios that do not require high integrity .
8.Memory
1.Memory The definition of
Memory: Memory database engine , All data is stored in memory , Reading and writing are very efficient , however MySQL After the service is restarted , Data will be lost , It does not support transactions 、 Foreign keys ,memory Support hash Index or B Tree index ,hash It's based on the index key Of the query , High query efficiency , The efficiency of range based query is relatively low .InnoDB and MyISAM Is based on B+ The data structure of the tree is realized .
2.Memory Analysis of advantages and disadvantages
Memory High reading and writing ability , however MySQL After reboot , Data will be lost , Foreign keys and transactions are not supported .
Applicable scenario : High reading and writing efficiency , Business scenarios that are not sensitive to data loss .
边栏推荐
- Ffmpeg captures RTSP images for image analysis
- Ffmpeg learning - core module
- Go learning --- structure to map[string]interface{}
- Leetcode:20220213 week race (less bugs, top 10% 555)
- Multithreading and high concurrency (8) -- summarize AQS shared lock from countdownlatch (punch in for the third anniversary)
- [online chat] the original wechat applet can also reply to Facebook homepage messages!
- Problems encountered in the database
- anconda下载+添加清华+tensorflow 安装+No module named ‘tensorflow‘+KernelRestarter: restart failed,内核重启失败
- Classical concurrency problem: the dining problem of philosophers
- Search (DFS and BFS)
猜你喜欢

小程序技术优势与产业互联网相结合的分析

Browser local storage

2022-02-13 work record -- PHP parsing rich text

认识提取与显示梅尔谱图的小实验(观察不同y_axis和x_axis的区别)

Analysis of the combination of small program technology advantages and industrial Internet

Knowledge about the memory size occupied by the structure

多线程与高并发(8)—— 从CountDownLatch总结AQS共享锁(三周年打卡)

Key structure of ffmpeg - avframe
![[noi simulation] Anaid's tree (Mobius inversion, exponential generating function, Ehrlich sieve, virtual tree)](/img/d6/c3128e26d7e629b7f128c551cd03a7.png)
[noi simulation] Anaid's tree (Mobius inversion, exponential generating function, Ehrlich sieve, virtual tree)

Mathematical model Lotka Volterra
随机推荐
State mode design procedure: Heroes in the game can rest, defend, attack normally and attack skills according to different physical strength values.
免费的聊天机器人API
Opencv classic 100 questions
Key structure of ffmpeg -- AVCodecContext
Global and Chinese markets of POM plastic gears 2022-2028: Research Report on technology, participants, trends, market size and share
Search (DFS and BFS)
notepad++正則錶達式替換字符串
Classical concurrency problem: the dining problem of philosophers
DEJA_VU3D - Cesium功能集 之 055-国内外各厂商地图服务地址汇总说明
Location based mobile terminal network video exploration app system documents + foreign language translation and original text + guidance records (8 weeks) + PPT + review + project source code
[noi simulation] Anaid's tree (Mobius inversion, exponential generating function, Ehrlich sieve, virtual tree)
PV static creation and dynamic creation
Global and Chinese markets of universal milling machines 2022-2028: Research Report on technology, participants, trends, market size and share
[Online gadgets] a collection of online gadgets that will be used in the development process
【NOI模拟赛】Anaid 的树(莫比乌斯反演,指数型生成函数,埃氏筛,虚树)
Basic introduction and source code analysis of webrtc threads
Priority queue (heap)
MySql——CRUD
小程序技术优势与产业互联网相结合的分析
An understanding of & array names



