84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
如题所示。 有一出货记录表 outDetail。表中大约3000W条数据。 字段如 outId, skuId, outDate, outQty等。
现想查出最近三个月没有出货的SKU号。有如下SQL: select skuId from outDetail group by skuId having max(outDate) < date_sub(curdate(), interval 90 day);
查询速度很慢。请问如何优化?
认证0级讲师
1. Table partition, by month. . I don’t know your business logic. Is one SKU unique in the shipping record table?
1. Table partition, by month. .
I don’t know your business logic. Is one SKU unique in the shipping record table?