
mysql
文章平均质量分 50
似一筷扣肉
这个作者很懒,什么都没留下…
展开
-
mysql查询今日,7日,30日大数据量sql优化
项目中存在数据量较大的流水数据,对流水数据进行按日,7日,30日,本月,本年等维度进行统计时,存在sql慢的问题,针对这一问题,对这类sql进行时间维度的优化,加索引,优化时间查询语句例:查询今日内数据 (50万数据条测试)优化前select a.time from tablewhere to_days(a.time) >= to_days(now())优化前sql运行0.734秒通过explain进行查询rows有50万条索引优化给table表的time字段加上index索引原创 2021-12-28 17:58:10 · 1810 阅读 · 0 评论 -
MySql连接报错communications link failure疑难问题
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Communications link failurecom.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failureThe last packet sent successfully to the server was 0 milliseconds ago. The driver has原创 2021-11-01 18:01:15 · 2138 阅读 · 0 评论 -
MySql使用GROUP_CONCAT出现In aggregated query without GROUP BY
Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'ie_llyh.u.ChkPlanID'; this is incompatible with sql_mode=only_full原创 2021-08-18 10:59:22 · 517 阅读 · 0 评论