性能优化
文章平均质量分 78
chengangcsdn
这个作者很懒,什么都没留下…
展开
-
mysql 性能优化之exists 写法不一样,性能提升400倍
业务需求查询订单中包含商品《高性能 mysql》的单据总量上代码select count(1) from saleorder a where a.tid = 180571 and exists(select 1 from saleorderdetail e1 where a.tid = e1.tid and a.billid = e1.billid and e1.goodsid in (1061)执行时间为 16smysql...原创 2021-01-06 14:13:41 · 3361 阅读 · 0 评论 -
mysql min函数优化
mysql min函数优化select min(id) from table where noindexfield = 'abc'当where条件未有索引,求的最小字段又是主键的时候,可采用select id from table wherenoindexfield = 'abc' limit 1优化方案出自高性能mysql...原创 2020-08-12 20:43:01 · 389 阅读 · 0 评论