改进现有MySQL左连接查询

改进现有MySQL左连接查询,mysql,Mysql,我的查询运行有点慢(比我希望的慢)。我知道MySQL的基本知识,但不足以优化查询。我的质询如下: SELECT a.index, a.date, b.description, a.type, a.place, a.value, b.space,a.val2 FROM a LEFT JOIN b ON a.index = b.index WHERE a.date >= ? and a.date < ? AND a.type = 100; 选择a.index、a.date、b.desc

我的查询运行有点慢(比我希望的慢)。我知道MySQL的基本知识,但不足以优化查询。我的质询如下:

SELECT a.index, a.date, b.description, a.type, a.place, a.value, b.space,a.val2
FROM a LEFT JOIN b ON a.index = b.index
WHERE a.date >= ? and a.date < ?
AND a.type = 100;
选择a.index、a.date、b.description、a.type、a.place、a.value、b.space、a.val2
从左连接a上的b.index=b.index
其中a.date>=?a.日期?
a.type=100;
我有一个关于A的索引和类型以及B的索引的索引。我知道这个查询可能会更快,所以我想知道是否有人知道一些适当的优化


谢谢

请使用“解释”找出您需要索引的位置“在日期上创建索引”和“在索引字段上键入索引”都很好,但是如果在a.date和a.type字段上运行,您可能希望将它们添加到索引中。谢谢大家的建议。