当前位置:网站首页>MySQL learning summary
MySQL learning summary
2022-07-01 16:52:00 【lix_ uan】
Three paradigms of database
First normal form: No more columns can be splitSecond normal form: On the basis of the first paradigm , Non primary key columns are completely dependent on the primary keyThird normal form: In the second paradigm , Non primary key columns only depend on primary keys , Do not rely on other non primary keys
Concurrency of transactions
Dirty reading: Business A Read transaction B Updated data , Then the data B Roll back , that A Read dirty dataIt can't be read repeatedly: Business A Read the same data multiple times , Business B In the transaction A In the process of reading, the data is modified and submitted , Lead to A The data read many times is differentFantasy reading: Business A When reading data , Business B Added data , Lead to A After reading, I found that there was still data I didn't read- Unrepeatable reading focuses on revision , Unreal reading focuses on adding or deleting
- To solve the problem of unrepeatable reading, you only need to lock the line , To solve phantom reading, you need to lock the table
The isolation level of the transaction
| Transaction isolation level | Dirty reading | It can't be read repeatedly |
|---|---|---|
| Read uncommitted | yes | yes |
| It can't be read repeatedly | no | yes |
| Repeatable | no | no |
| Serialization | no | no |
b-tree、b+tree The difference between
- b-tree Key words of 、 Indexes and records are put together
- b+tree Records of are only placed in leaf nodes , Instead of leaf nodes, there are only keywords and indexes pointing to the next node
- b-tree The closer to the root node, the faster the record lookup event , Just find the keyword to confirm the existence of the record
- b+tree The search events of each record in are basically the same , You need to go from the root node to the leaf node
- b+tree The cost of disk reading and writing is lower , Query efficiency is more stable ,b+tree More suitable for indexing
drop、delete、truncate The difference between
- Use it directly when you don't need another table drop Delete
- Delete all data , But keep the table structure with truncate
- Use when you want to delete some data delete
union and union all The difference between
- union It will get more data for de duplication and sorting
- union all All query results will be preserved , There will be no de duplication and sorting
- Without losing weight ,union all It's more efficient
char and varchar The difference between
- char, Fixed length , Fixed length strings are recommended char Type storage , Space saving and efficient
- varchar, Indefinite length , Low efficiency
Why should a field be defined as not null
- null Values take up more bytes , And it will cause many unexpected situations in the program
边栏推荐
- China benzene hydrogenation Market Research and investment forecast report (2022 Edition)
- P2893 [usaco08feb] making the grade g (DP & priority queue)
- How to use F1 to F12 correctly on laptop keyboard
- 数据库系统原理与应用教程(001)—— MySQL 安装与配置:MySQL 软件的安装(windows 环境)
- Why is the pkg/errors tripartite library more recommended for go language error handling?
- Borui data integrated intelligent observable platform was selected into the "Yunyuan production catalogue" of China Academy of communications in 2022
- P2893 [USACO08FEB] Making the Grade G(dp&优先队列)
- Sword finger offer II 015 All modifiers in the string
- 数据库系统原理与应用教程(003)—— MySQL 安装与配置:手工配置 MySQL(windows 环境)
- C語言輸入/輸出流和文件操作
猜你喜欢

Installation and use of sqoop

Introduction to software engineering - Chapter 6 - detailed design

Exclusive news: Alibaba cloud quietly launched RPA cloud computer and has opened cooperation with many RPA manufacturers

博睿数据一体化智能可观测平台入选中国信通院2022年“云原生产品名录”

Défaillance lors du démarrage de la machine virtuelle VMware: le poste de travail VMware n'est pas compatible avec hyper - V...

String class

Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world

Tutorial on the principle and application of database system (002) -- MySQL installation and configuration: MySQL software uninstallation (Windows Environment)

数据库系统原理与应用教程(003)—— MySQL 安装与配置:手工配置 MySQL(windows 环境)

如何使用 etcd 实现分布式 /etc 目录
随机推荐
你还在用收费的文档管理工具?我这有更牛逼的选择!完全免费
How to solve the keyboard key failure of notebook computer
阿里云、追一科技抢滩对话式AI
China sorbitol Market Forecast and investment strategy report (2022 Edition)
免费抽奖 | 《阿巴豆》探索未来系列盲盒数字版权作品全网首发!
Redis distributed lock
机器学习11-聚类,孤立点判别
数据库系统原理与应用教程(002)—— MySQL 安装与配置:MySQL 软件的卸载(windows 环境)
博睿数据一体化智能可观测平台入选中国信通院2022年“云原生产品名录”
How to use phpipam to manage IP addresses and subnets
Basic use of MySQL
Comprehensively view the value of enterprise digital transformation
Girls who want to do software testing look here
P2592 [ZJOI2008]生日聚会(dp)
Zabbix2.2 monitoring system and application log monitoring alarm
Introduction to software engineering - Chapter 6 - detailed design
Are you still using charged document management tools? I have a better choice! Completely free
Activity的生命周期和启动模式详解
Babbitt | yuan universe daily must read: Naixue coin, Yuan universe paradise, virtual stock game Do you understand Naixue's tea's marketing campaign of "operation pull full"
想做软件测试的女孩子看这里