当前位置:网站首页>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
边栏推荐
- Redis~Geospatial(地理空间)、Hyperloglog(基数统计)
- [Yocto RM]9 - QA Error and Warning Messages
- Complex and inefficient logistics? Three steps to solve problems in enterprise administration
- Leetcode topic [array] -228- summary interval
- KVM related
- Mysql大合集,你要内容的这里全都有
- geojson 格式說明(格式詳解)
- Jenkins - Groovy Postbuild 插件丰富 Build History 信息
- 我今天忘带手机了
- Jenkins - built in variable access
猜你喜欢

Wangxinling, tanweiwei Shanhai (extended version of Chorus) online audition lossless FLAC Download

Machine learning notes - time series as features

SQL injection bypass (IV)

Take n multiple table names of a database as the values of a column in another table (the range can be a table in another database)

【ELT.ZIP】OpenHarmony啃论文俱乐部—数据密集型应用内存压缩

Numpy----np. Tile() function parsing

Appium自动化测试基础— 补充:App的包名(appPackage)和启动名(appActivity)

Numpy----np. meshgrid()

王心凌、谭维维 - 山海(副歌加长版) 在线试听无损FLAC下载

Cesium 多边形(polygon)extrudedHeight 和 height 的区别
随机推荐
Cesium obtains the latitude and longitude range of the screen
Voice network VQA: make the user's subjective experience of unknown video quality in real-time interaction known
To understand what is synchronous, asynchronous, serial, parallel, concurrent, process, thread, and coroutine
匿名挂载&具名挂载
Ionic4 realizes half star scoring
Jenkins - data sharing and transfer between copy artifact plug-in builds
将某数据库N多表名作为另外一张表中某一列得值(范围可以是别的数据库中得某张表)
Use code binding DataGridView control to display tables in program interface
Leetcode topic [array] -228- summary interval
SQL 注入绕过(三)
KVM related
To understand what is synchronous, asynchronous, serial, parallel, concurrent, process, thread, and coroutine
CVPR22收录论文|基于标签关系树的层级残差多粒度分类网络
[Yocto RM]9 - QA Error and Warning Messages
后勤事务繁杂低效?三步骤解决企业行政管理难题
MySQL优化小技巧
Cesium 抗锯齿(线,边框等)
架构高可靠性应用知识图谱 ----- 架构演进之路
Machine learning (x) reinforcement learning
STM32F103的11个定时器