当前位置:网站首页>Mysql比较
Mysql比较
2022-06-11 09:28:00 【宇1990】
sql优化:https://www.cnblogs.com/lonnie/p/8320095.html
1、当数据库统计一天的数据但是数据库字段存的是datatime类型的时候(当然最好是直接使用data日期类型)
where语句当中使用data_format和like的时间区别(原则最好在where语句的右边最好不要有函数计算同时也不要使用like这样会造成遍历全表 )确实要使用的时候 同样的表 数据5855603条数据的时候
select * from dobi_core.t6027
where F06 like '2019-08-31%'执行多次一般在8s左右
select * from dobi_core.t6027
where date_format( F06 ,'%Y-%m-%d') = '2019-08-31'而使用计算的时候一般需要9.5s左右
select * from dobi_core.t6027 where F06 >= '2019-08-31 00:00:00' and F06 < '2019-09-01 00:00:00'执行如上耗时间一般在8.5s左右
综上当使用日期统计时,最后还是用上述方式
边栏推荐
- Day39 process object and other method mutexes
- Day 47 how to query a table
- Augmented reality experiment IV of Shandong University
- The ins-30131 installer failed to verify the required initial settings
- Package details
- Sword finger offer II 041 Average value of sliding window
- Oracle 11g RAC disk group has space and cannot add data files?
- Automation operation and maintenance articles collection
- Flask (II) - route
- [scheme design] scheme of household oximeter based on single chip microcomputer
猜你喜欢

赛灵思引脚约束文件 .xdc

Concurrent programming

Openstack explanation (24) -- registration of neutron service

The ins-30131 installer failed to verify the required initial settings

MSF SMB based information collection

考研數學 【數列極限證明題】題型方法總結

ESP8266_GET请求天气预报、json解析

Shandong University project training (IV) -- wechat applet scans web QR code to realize web login

The difference and relation between machine learning and statistics

Zhiyun health submitted the statement to HKEx again: the loss in 2021 exceeded 4billion yuan, an increase of 43% year-on-year
随机推荐
js基础--Date对象
[TiO websocket] IV. the TiO websocket server implements the custom cluster mode
1854. the most populous year
Esp8266 Smartconfig
Ora-00059 exceeds DB_ Files limit
Version mismatch between installed deeply lib and the required one by the script
Résumé de la méthode d'examen des mathématiques
How to determine whether two time periods overlap?
About prototype and prototype chain
Flask (III) -- variable rules
Touch事件的tap,longtap封装--来自小野
Oracle XDB組件的重建
Video review pulsar summit Asia 2021, cases, operation and maintenance, ecological dry goods
Monotone stack
Don't use redis list to implement message queue. Stream is designed for queues
[TiO websocket] III. The TiO websocket server can send messages to users anywhere
1400. construct K palindrome strings
Day41 process pool and thread pool
整型提升例题
【Objective-C】动态创建控件