当前位置:网站首页>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
边栏推荐
- RestTemplate使用
- mysql数据类型学习笔记
- On siem
- [ManageEngine Zhuohao] what is network operation and maintenance management and what is the use of network operation and maintenance platform
- Excel visualization
- Redis安装到Windows系统上的详细步骤
- SystemVerilog learning-10-validation quantification and coverage
- C language course set up student elective course system (big homework)
- Interview questions for HW (OD) post
- 微信公众号内嵌跳转微信小程序方案总结
猜你喜欢

C语言课设学生选修课程系统(大作业)

C language course is provided with employee information management system (large operation)

C语言课设物业费管理系统(大作业)

虚幻 简单的屏幕雨滴后处理效果

【微信小程序】一文解决button、input、image组件

Async and await
![[ManageEngine] how to realize network automatic operation and maintenance](/img/8a/75332d3180f92c6a6482d881032bbf.png)
[ManageEngine] how to realize network automatic operation and maintenance

概率论学习笔记

HCM Beginner (IV) - time

Embedded system
随机推荐
C语言课设图书信息管理系统(大作业)
Excel visualization
SQL学习笔记九种连接2
JMM详解
HCM Beginner (IV) - time
[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
三说 拷贝构造之禁用
Three minutes to quickly understand the whole process of website development
DSBridge
Internet worm
10-golang运算符
ManageEngine卓豪助您符合ISO 20000标准(四)
C language course is provided with employee information management system (large operation)
sql中TCL语句(事务控制语句)
Draw a directed graph based on input
谷粒商城-环境(p1-p27)
Idea easy to use plug-in summary!!!
Redis安装到Windows系统上的详细步骤