当前位置:网站首页>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
边栏推荐
- FPGA - clocking -02- clock wiring resources of internal structure of 7 Series FPGA
- 数据库产生死锁了请问一下有没有解决办法
- C语言课设学生信息管理系统(大作业)
- 数据库对象:视图学习记录
- JMM详解
- 伪装请求头库: anti-useragent
- ForkJoin和Stream流测试
- SystemVerilog learning-09-interprocess synchronization, communication and virtual methods
- 华福证券开户是安全可靠的么?怎么开华福证券账户
- 绕圆旋转动画组件,拿过来直接用
猜你喜欢

SystemVerilog learning-08-random constraints and thread control

虚幻 简单的屏幕雨滴后处理效果
![[ManageEngine Zhuohao] helps Julia college, the world's top Conservatory of music, improve terminal security](/img/fb/0a9f0ea72efc4785cc21fd0d4830c2.png)
[ManageEngine Zhuohao] helps Julia college, the world's top Conservatory of music, improve terminal security

2022 年江苏省职业院校技能大赛(中职) 网络搭建与应用赛项公开赛卷

C language course design student information management system (big homework)

FPGA - 7 Series FPGA internal structure clocking-01-clock Architecture Overview
![[unity shader custom material panel part II]](/img/d1/8632ae680299a27b7431b2d6e03fd3.png)
[unity shader custom material panel part II]

Redis安装到Windows系统上的详细步骤

Promise
![[unity shader stroke effect _ case sharing first]](/img/bd/5cd1bef24e6b6378854114c2c05bd9.png)
[unity shader stroke effect _ case sharing first]
随机推荐
[ManageEngine Zhuohao] use unified terminal management to help "Eurex group" digital transformation
C language course set up salary management system (big homework)
C#如何打印输出原版数组
Minio error correction code, construction and startup of distributed Minio cluster
[unity shader custom material panel part II]
JMM details
SystemVerilog learning-09-interprocess synchronization, communication and virtual methods
NOC 设计的一些坑
考研目录链接
Discrimination between left and right limits of derivatives and left and right derivatives
Uniapp tree level selector
Code power is full of quantitative learning | how to find a suitable financial announcement in the financial report
SQL学习笔记2
2022 年江苏省职业院校技能大赛(中职) 网络搭建与应用赛项公开赛卷
async 与 await
Promise
给逆序对数求原数组
Student attendance system for C language course (big homework)
@Propagation property of transactional requires_ New in-depth understanding
【微信小程序】如何搭积木式开发?