当前位置:网站首页>Date of SQL optimization_ Format() function
Date of SQL optimization_ Format() function
2022-06-11 20:08:00 【A man who didn't want to be named】
There is a problem in the online environment today , Front end interface request timed out , I immediately ran to the formal environment to run the request timeout sql, Shock me , It's running well 30 More than a second , This is not acceptable. , We have to optimize it quickly , But there is something left to look up and down , No problem! , therefore , Asked the great God of our group , He saw the problem at a glance , The problem is DATE_FORMAT() This function , So , I want to make a record , I hope you don't step on the pit .
If the amount of data is small , Application DATE_FORMAT() Performance is not affected , But once the amount of data is large After that , There will be performance problems slowly , This is also because the test environment did not find out , This problem occurs in the formal environment .
For demonstration : I put it in my watch
Tens of millions of data ,

The data structure is like this , I want to find out regist_date yes 2018 Years of data
I'll fix this sql:

when :
After optimization, execute :
![]()
Performance is flying :
Why , because DATE_FORMAT Function will invalidate the index , Therefore, this function is not recommended for large data volume .
边栏推荐
- Power supply anti reverse connection and anti backflow - use MOS tube and op amp to realize ideal diode
- STL容器嵌套容器
- "Video version Mae" of hekaiming team, efficient video pre training! The effect is also very good when mask ratio is up to 90
- Explanation of LNMP architecture source code compilation and installation with pictures and texts (with forum experiment)
- STC hardware only automatic download circuit V2
- Unified exception handling
- sql优化之DATE_FORMAT()函数
- The first bullet of comparative learning
- 【Bug解决】UnpicklingError: A load persistent id instruction was encountered, but no persistent_load.
- LNMP架构源码编译安装图文讲解(附带搭建论坛实验)
猜你喜欢

AHB2Standard_ handshake_ Bridge design

Simulate Oracle lock waiting and manual unlocking

In 2021, the global revenue of minoxidil will be about 1035million US dollars, and it is expected to reach 1372.6 million US dollars in 2028

Shanghai internal promotion 𞓜 Yuyang teacher's research group of Shanghai Chizhi research institute recruits full-time researchers

Première formation sur les largeurs modernes

Skywalking source code analysis Part 5 - server configuration configuration module startup

In 2021, the global revenue of Indian fragrant rice was about $12530 million, and it is expected to reach $21670 million in 2028

"Video version Mae" of hekaiming team, efficient video pre training! The effect is also very good when mask ratio is up to 90

29. location對象

29. Objet de localisation
随机推荐
Première formation sur les largeurs modernes
In unity, opencv and QT are used to create a plugin (I)
[Err] 1045 - Access denied for user ‘root‘@‘%‘ (using password: YES)
Experiment report of basic mechanical experiment (II) of School of distance and continuing education, Dalian University of technology [standard answer]
sql优化之DATE_FORMAT()函数
Using the flask framework to write the bezel
2022-2028 global and Chinese thermal power generation (TEG) module market status and future development trend
[bug resolution] unpickingerror: a load persistent ID instruction was encoded, but no persistent_ load.
moderlarts第二次作业
Tensorflow --- creation and reading of tfrecord file
Explanation of LNMP architecture source code compilation and installation with pictures and texts (with forum experiment)
Lecture 30 linear algebra Lecture 2 Matrix
[Sichuan University] information sharing of the first and second examinations
"Video version Mae" of hekaiming team, efficient video pre training! The effect is also very good when mask ratio is up to 90
ICML 2022 | 基于结构化数据的异常检测再思考:我们究竟需要怎样的图神经网络?...
秀创意,赢显卡!MMPose姿态估计创意大赛震撼来袭
Off line operation of situation and policy (version) of Dayong in autumn 21 [standard answer]
ICML 2022 𞓜 rethinking anomaly detection based on structured data: what kind of graph neural network do we need
Interface isolation principle
STL container nested container