当前位置:网站首页>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
边栏推荐
- UML旅游管理系统「建议收藏」
- 为国产数据库添砖加瓦,StoneDB 一体化实时 HTAP 数据库正式开源!
- Ring iron pronunciation, dynamic and noiseless, strong and brilliant, magic wave hifiair Bluetooth headset evaluation
- 美国国家安全局(NSA)“酸狐狸”漏洞攻击武器平台技术分析报告
- 判断二叉树是否为二叉搜索树
- 红队第10篇:coldfusion反序列化过waf改exp拿靶标的艰难过程
- OJ questions related to complexity (leetcode, C language, complexity, vanishing numbers, rotating array)
- VMware 虛擬機啟動時出現故障:VMware Workstation 與 Hyper-v 不兼容...
- P2893 [USACO08FEB] Making the Grade G(dp&优先队列)
- Internet News: "20220222" get together to get licenses; Many products of Jimi have been affirmed by consumers; Starbucks was fined for using expired ingredients in two stores
猜你喜欢

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

PR basic clip operation / video export operation

Analysis of PostgreSQL storage structure

Activity的生命周期和启动模式详解

SQL question brushing 627 Change gender

Hi Fun Summer, play SQL planner with starrocks!
![[jetsonnano] [tutorial] [introductory series] [III] build tensorflow environment](/img/0e/52e37527bc717c7a55741725087bad.png)
[jetsonnano] [tutorial] [introductory series] [III] build tensorflow environment

毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?

数据库系统原理与应用教程(002)—— MySQL 安装与配置:MySQL 软件的卸载(windows 环境)

软件工程导论——第六章——详细设计
随机推荐
嗨 FUN 一夏,与 StarRocks 一起玩转 SQL Planner!
How to use phpipam to manage IP addresses and subnets
机器学习11-聚类,孤立点判别
数据库系统原理与应用教程(003)—— MySQL 安装与配置:手工配置 MySQL(windows 环境)
Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world
[pyg] document summary and project experience (continuously updated
剑指 Offer II 015. 字符串中的所有变位词
Detailed explanation of activity life cycle and startup mode
C language input / output stream and file operation
独家消息:阿里云悄然推出RPA云电脑,已与多家RPA厂商开放合作
sql刷题584. 寻找用户推荐人
Are you still using charged document management tools? I have a better choice! Completely free
Tutorial on the principle and application of database system (005) -- Yum offline installation of MySQL 5.7 (Linux Environment)
P2592 [zjoi2008] birthday party (DP)
Internet News: "20220222" get together to get licenses; Many products of Jimi have been affirmed by consumers; Starbucks was fined for using expired ingredients in two stores
模板引擎Velocity 基础
挖财学堂班主任给的证券账户安全吗?能开户吗?
拼接字符串,得到字典序最小的结果
Dataframe gets the number of words in the string
红队第10篇:coldfusion反序列化过waf改exp拿靶标的艰难过程