【发布时间】:2016-06-08 17:27:43
【问题描述】:
这是我的查询:
DELETE FROM events WHERE type = 4 AND author_id IN (?, ?) AND post_id IN (?, ?)
这是我目前所有的索引:
(id) -- PK
(author_id, seen)
(author_id, date_time)
(type, other_id, author_id)
(comment_id, type, author_id)
那么,我应该为上面的查询添加任何新索引吗?
【问题讨论】:
-
这个答案很大程度上取决于您的数据。不幸的是,在索引方面没有万能的答案。架构、数据、数据分布、如何调用语句等......在确定索引时应考虑所有这些因素。