当前位置:网站首页>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
边栏推荐
- 系统管理员设置了系统策略,禁止进行此安装。解决方案
- Appium automation test foundation ADB common commands (I)
- Appium自动化测试基础— 补充:App的包名(appPackage)和启动名(appActivity)
- Machine learning notes - time series as features
- Ionic4 realizes half star scoring
- pytorch_ lightning. utilities. exceptions. MisconfigurationException: You requested GPUs: [1] But...
- What is a web crawler
- 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)
- There appears to be a failure with your network connection Retrying.
- mysql面试百题集
猜你喜欢
The system administrator has set the system policy to prohibit this installation. Solution
Jenkins - access the Jenkins user-defined parameter variable, and handle the variable value containing spaces
Using redis bitmap to realize personnel online monitoring
Use code binding DataGridView control to display tables in program interface
如何以数据驱动「客户全生命周期管理」,提高线索转化率及客户满意度?
《低代码解决方案》——覆盖工单、维修和财务全流程的数字化售后服务低代码解决方案
Cesium 多边形(polygon)extrudedHeight 和 height 的区别
SQL injection bypass (2)
Cesium anti aliasing (lines, borders, etc.)
后勤事务繁杂低效?三步骤解决企业行政管理难题
随机推荐
frp实现内网穿透
Use code binding DataGridView control to display tables in program interface
OSI 7层模型讲解(大白话 通俗易懂)
Prometeus 2.35.0 new features
树莓派实现温控风扇智能降温
geojson 格式说明(格式详解)
4G-learn from great partners
General process after reference layer reboot
Description du format geojson (détails du format)
JS 随机数(随机数 小数)
KVM相关
SQL 注入绕过(三)
MySQL interview question set
[Yocto RM]1 - System Requirements
Cesium 抗锯齿(线,边框等)
Raspberry pie realizes intelligent cooling by temperature control fan
Coscon'22 lecturer solicitation order
投资同业存单基金是靠谱吗,同业存单基金安全吗
Jenkins - Groovy Postbuild 插件丰富 Build History 信息
Mysql查询相关知识(进阶七:子查询