我在 Mysql select 语句中有计算。我发现它使查询变慢。
SELECT MIN(a) AS MIN,
ROUND(100*(a/b), 1) AS mos
FROM TABLE_NAME
WHERE a > 0
AND b > 0
AND c <= 148
AND d >=-100 HAVING mos <= 300.1
如果我删除计算,它会快得多。
SELECT a,b
FROM TABLE_NAME
WHERE a > 0
AND b > 0
AND c <= 148
AND d >=-100
我已经为 a、b、c、d 创建了一个索引。有什么建议可以让它更快吗?