当前位置:网站首页>MySQL learning
MySQL learning
2022-07-01 06:33:00 【A small salted fish I】
List of articles
- sql Optimize
- The underlying implementation principle and optimization of index
- Binary tree 、 Balanced binary trees 、b Trees 、b+ Trees
- What are the principles for indexing data tables ?
- When is it not appropriate to build an index ?
- What is a lock ?
- What is stored procedure ? What to call ?
- Say yes SQL What are the methods of statement optimization ?( Choose a few )
sql Optimize
It's best to optimize in the following order :
1、SQL Statement and index optimization
2、 Database table structure optimization
3、 Optimization of system configuration
4、 Hardware optimization
details
The underlying implementation principle and optimization of index
B+ Trees , Optimized B+ Trees
It mainly adds a pointer to the next leaf node among all leaf nodes , therefore InnoDB build
It is recommended that most tables use the default self incrementing primary key as the primary index .
Binary tree 、 Balanced binary trees 、b Trees 、b+ Trees
B+ Trees , Optimized B+ Trees
It mainly adds a pointer to the next leaf node among all leaf nodes , therefore InnoDB build
It is recommended that most tables use the default self incrementing primary key as the primary index .
What are the principles for indexing data tables ?
In the most frequently used 、 To narrow the scope of the query to build an index on the field .
In frequent use 、 Index the fields that need to be sorted
When is it not appropriate to build an index ?
For the columns rarely involved in the query or the columns with more duplicate values , It's not good to index .
For some special data types , It's not good to index , For example, text field (text) etc.
What is a lock ?
answer : Database is a shared resource used by multiple users . When multiple users access data concurrently , In number
Multiple transactions access the same data at the same time in the database . If you do not control concurrent operations, you can
Can read and store incorrect data , Breaking database consistency .
Locking is a very important technology to realize database concurrency control . When a transaction is processing a data object
Before the operation , Make a request to the system first , Lock it . After locking, the transaction has a certain effect on the data object
The control of , Before the transaction releases the lock , Other transactions cannot update this data object .
Basic lock type : Locks include row level locks and table level locks
What is stored procedure ? What to call ?
answer : Stored procedure is a precompiled SQL sentence , The advantage is to allow modular design , That means just
To create a , Later in the program can be called many times . If an operation needs to be performed more than once SQL,
Using stored procedures is better than just SQL Statement execution should be fast . You can call a stored procedure with a command object
Say yes SQL What are the methods of statement optimization ?( Choose a few )
1、Where clause :where Connections between tables must be written in other Where Before condition , Those can be
The condition to filter out the maximum number of records must be written in Where End of clause .HAVING Last .
2、 use EXISTS replace IN、 use NOT EXISTS replace NOT IN. 3、 Avoid using calculations on index columns
4、 Avoid using... On index columns IS NULL and IS NOT NULL
5、 Optimize the query , Try to avoid full scan , The first thing to consider is where And order by Involve
Index the columns of and .
6、 Should try to avoid in where Field in the clause null Value judgement , Otherwise, it will cause the engine to give up
Full table scan using index
7、 Should try to avoid in where The clause performs an expression operation on the field , This will cause the engine to be abandoned
Index and scan the whole table
边栏推荐
- C语言课设工资管理系统(大作业)
- 高阶-二叉搜索树详解
- VS2019如何永久配置本地OpenCV4.5.5使用
- FPGA - clocking -02- clock wiring resources of internal structure of 7 Series FPGA
- 常用快捷键
- [ManageEngine Zhuohao] helps Huangshi Aikang hospital realize intelligent batch network equipment configuration management
- To sort out the anomaly detection methods, just read this article!
- SystemVerilog learning-08-random constraints and thread control
- Student attendance system for C language course (big homework)
- 【Unity Shader 消融效果_案例分享】
猜你喜欢
NOC 设计的一些坑
How did ManageEngine Zhuohao achieve the goal of being selected into Gartner Magic Quadrant for four consecutive years?
C语言课设物业费管理系统(大作业)
[enterprise data security] upgrade backup strategy to ensure enterprise data security
ManageEngine Zhuohao helps you comply with ISO 20000 standard (IV)
[self use of advanced mathematics in postgraduate entrance examination] advanced mathematics Chapter 1 thinking map in basic stage
SystemVerilog learning-08-random constraints and thread control
C语言课设销售管理系统设计(大作业)
[unity shader stroke effect _ case sharing first]
图片服务器项目测试
随机推荐
Restframework-simplejwt rewrite authentication mechanism
Three minutes to quickly understand the whole process of website development
码力十足学量化|如何在财务报告寻找合适的财务公告
C语言课设销售管理系统设计(大作业)
【KV260】利用XADC生成芯片温度曲线图
高阶-二叉平衡树
[summary of problem thinking] Why is the register reset performed in user mode?
Lxml module (data extraction)
@Transactional的传播属性REQUIRES_NEW深入理解
软件工程复习
json模块
Detailed steps for installing redis on Windows system
ManageEngine卓豪助您符合ISO 20000标准(四)
libpng12.so. 0: cannot open shared object file: no such file or directory
High order binary search tree
Idea easy to use plug-in summary!!!
Forkjoin and stream flow test
解决The code generator has deoptimised the styling of xxxx.js as it exceeds the max of 500kb
【微信小程序】视图容器和基本内容组件
Find the original array for the inverse logarithm