当前位置:网站首页>InnoDB, MySQL structure, and the difference between the three kinds of deletion
InnoDB, MySQL structure, and the difference between the three kinds of deletion
2022-07-19 02:32:00 【HYYyyying】
Extract 、 Transferred from a Xiu
1、innodb Why use self increasing id A primary key
Use self increasing id A primary key :
Every time you insert a new record , It will be added to the subsequent positions of the current inode in sequence , When a page is full , Will open a new page
Use non self increasing id A primary key :
Not self increasing id( Student number 、 ID number ), The value of each inserted primary key is approximately random , So every time a new record is inserted into the middle of the existing index page . Frequent movement 、 Paging caused a lot of fragmentation , The index structure is not compact enough , I have to go through OPTIMIZE TABLE To rebuild the table and optimize the page population
2、MySQL structure , Service tier and storage engine tier

contain Service layer and Storage engine layer ,
Service layer :
The connector : Verify user identity , Give authority
The query cache : If there is a cache, it directly returns , If it does not exist, follow-up operations will be performed
analyzer : Yes SQL Do lexical and grammatical analysis
Optimizer : Mainly for the implementation of SQL Optimize and select the best execution scheme
actuator : The actuator will first check whether the user has execution permission , You can use the interface provided by this engine
Storage engine layer :
Responsible for data storage and extraction , Provide read-write interface
3、drop、delete、truncate Common ground and difference of
delete: Delete all or data rows of the table , perform delete after , Users need to submit (commite) To perform the deletion , Or rollback (rollback) To undo the deletion ; Will trigger all of this table delete trigger
truncate: Delete all data in the table , Cannot be rolled back , It will not start the trigger of this table ,truncate Than delete faster , Take up less space
drop: Delete tables from the database , All the data lines 、 Indexes and permissions will be deleted , be-all DML Trigger will not be triggered , Cannot be rolled back
delete and truncate Delete only data
边栏推荐
- [unity development tips] unity packs the EXE on the PC side and compresses and packs it into an EXE file
- [Ruiji takeout ⑩] rough learning of Linux & rough learning of redis
- 剑指 Offer 48. 最长不含重复字符的子字符串
- [tools] unity screen drawing line, unity screen drawing Hsj drawing tool
- [unity Editor Extension] unity publishes resources to the store process unity asset store publish
- flask模板注入
- sqlmap的使用
- 逻辑漏洞---登录验证码安全
- CTFHub----RCE
- bugku----正则匹配,cookies
猜你喜欢
随机推荐
SoloPi APP性能测试用
find()(名字太多人用我就加字)
Software testing technology interim testing summary | software testing foundation & Executive testing & test design and development
全链路压测
接口(Collection/Map)- 各接口的实现与对比
Injection de modèles ssti
逆元(名字太多人用我就加这几个字)
Bugku---- regular matching, cookies
php伪协议实现命令执行
【Unity编辑器扩展】快速定位资源和脚本的指定文件和路径
Project Performance Optimization Practice: solve the white screen problem of the home page, customize the loading animation to optimize the first screen effect
Jmeter beanshell实现把请求生成的参数化数据写入文件
Network layer transmission protocol (detailed)
3D NFT的破茧重生:Caduceus去中心化边缘渲染技术
How to configure multiple SSH keys for novices (easy to understand hand-in-hand teaching)
STL -- List container (linked list)
第2章-系统控制原理 -> 经典控制理论
攻防世界----shrine
[antv G2] how to add a click event to the line chart (click anywhere to get the value of the point on the line)
STL -- set container







