当前位置:网站首页>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
边栏推荐
- 【Kotlin】高阶函数介绍
- 红队第10篇:coldfusion反序列化过waf改exp拿靶标的艰难过程
- Borui data integrated intelligent observable platform was selected into the "Yunyuan production catalogue" of China Academy of communications in 2022
- Apple's self-developed baseband chip failed again, which shows Huawei Hisilicon's technological leadership
- SystemVerilog-结构体(二)
- [pyg] document summary and project experience (continuously updated
- 阿里云、追一科技抢滩对话式AI
- Sword finger offer II 015 All modifiers in the string
- ShenYu 网关开发:在本地启用运行
- 游戏行业安全选择游戏盾,效果怎么样?
猜你喜欢

【直播预约】数据库OBCP认证全面升级公开课

Building blocks for domestic databases, stonedb integrated real-time HTAP database is officially open source!

Today, at 14:00, 15 ICLR speakers from Hong Kong University, Beihang, Yale, Tsinghua University, Canada, etc. continue!

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

Ring iron pronunciation, dynamic and noiseless, strong and brilliant, magic wave hifiair Bluetooth headset evaluation

Redis distributed lock

SQL question brushing 1050 Actors and directors who have worked together at least three times

Redis6.0 新功能

Analysis of PostgreSQL storage structure

Dataframe gets the number of words in the string
随机推荐
How to maintain the laptop battery
数据库系统原理与应用教程(004)—— MySQL 安装与配置:重置 MySQL 登录密码(windows 环境)
What is the digital transformation of manufacturing industry
Exclusive news: Alibaba cloud quietly launched RPA cloud computer and has opened cooperation with many RPA manufacturers
GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速
China nylon 11 industry research and future forecast report (2022 Edition)
Research and investment strategy report of neutral protease industry in China (2022 Edition)
AI college entrance examination volunteer filling: the gods of Dachang fight, and candidates pay to watch
Virtual serial port simulator and serial port debugging assistant tutorial "suggestions collection"
SQL question brushing 627 Change gender
判断链表是否是回文链表
SystemVerilog-结构体(二)
How to repair the laptop that cannot connect to the wireless network
China benzene hydrogenation Market Research and investment forecast report (2022 Edition)
Concatenate strings to get the result with the smallest dictionary order
红队第8篇:盲猜包体对上传漏洞的艰难利用过程
巴比特 | 元宇宙每日必读:奈雪币、元宇宙乐园、虚拟股票游戏...奈雪的茶这波“操作拉满”的营销活动你看懂了吗?...
China sorbitol Market Forecast and investment strategy report (2022 Edition)
Introduction to software engineering - Chapter 6 - detailed design
软件工程导论——第六章——详细设计