当前位置:网站首页>MySQL optimization tips
MySQL optimization tips
2022-06-28 02:31:00 【Minsk open source】
max()
For example, a sql select max(money) from pay, When querying, the full table will be scanned to find out the maximum value , But if we give money Add an index , Execution efficiency will be fast , Because this is equivalent to an overlay index , Indexes are sequential , No need to scan for
count()

count(*) The empty columns will also be calculated ,count(release_year), If you specify which field directly, the empty column will not be calculated
Sub query optimization
Usually, the subquery is transformed into join To query , But pay attention to data duplication
limit Query optimization
limit Usually accompanied by order by Sort , So it's going on order by When sorting fields, it is best to use indexed fields or primary keys
Index optimization
====
How to select an appropriate column to create an index

The dispersion refers to the 《 A big factory Java Analysis of interview questions + Back end development learning notes + The latest architecture explanation video + Practical project source code handout 》 Free open source Prestige search official account 【 Advanced programming 】 How many values are not repeated , The greater the dispersion , In the joint index, it should be placed in front of
Delete unused indexes and duplicate indexes
Database table structure optimization
========
Choose the right data type
Paradigm and anti paradigm optimization

Table vertical split

Table split horizontally
Horizontal splitting is to solve the problem of too much data in a single table , It can be split by modulo operation , The table structure of each table is the same , The resulting problems are query and background analysis statistics , When statistics are available, the table is summarized , Query should consider specific business scenarios for operation
System profile optimization
========
innodb_buffer_pool_size
边栏推荐
- 【sylixos】i2c设备驱动创建和使用
- Ti am3352/54/59 industrial core board hardware specification
- 共阳极数码管真值表
- KVM related
- ShardingSphere-proxy-5.0.0建立mysql读写分离的连接(六)
- 类的初始化与回调的用法
- How to use metauniverse technology to create a better real world
- 架构高可靠性应用知识图谱 ----- 架构演进之路
- Deep parsing of kubernetes controller runtime
- 文件傳輸協議--FTP
猜你喜欢

树莓派实现温控风扇智能降温

SQL injection bypass (2)

Machine learning (x) reinforcement learning

Raspberry pie realizes intelligent cooling by temperature control fan

Ti am3352/54/59 industrial core board hardware specification

Dynamic Host Configuration Protocol

1382. balancing binary search tree - General method

Jenkins - Pipeline concept and creation method

How to use data-driven "customer lifecycle management" to improve lead conversion rate and customer satisfaction?

Cesium Click to draw polygons (dynamically draw polygons)
随机推荐
外盘期货哪里可以开户?哪个平台出入金比较安全?
Cesium 多边形增加文字标签(polygon 加 label)多边形中心点偏移问题解决
yarn下载报错There appears to be trouble with your network connection. Retrying.
JS 数组随机取值(随机数组取值)
图灵机启动顺序
Ti am3352/54/59 industrial core board hardware specification
王心凌、谭维维 - 山海(副歌加长版) 在线试听无损FLAC下载
Solve the problem that the page cannot scroll when ionic4 uses the hammerjs gesture press event
Leetcode topic [array] -228- summary interval
【永艺XY椅】试用体验
Jenkins - 内置变量访问
Machine learning (x) reinforcement learning
geojson 格式说明(格式详解)
树莓派实现温控风扇智能降温
Anonymous Mount & named mount
[elt.zip] openharmony paper Club - memory compression for data intensive applications
Description du format geojson (détails du format)
【ELT.ZIP】OpenHarmony啃论文俱乐部—数据密集型应用内存压缩
Low code solution - a low code solution for digital after-sales service covering the whole process of work order, maintenance and Finance
OSI 7层模型讲解(大白话 通俗易懂)