它需要大量的资源。我同时播放一些长时间运行的查询,服务器出现故障。
查询就像
SELECT posts.id
FROM posts
WHERE postId = '765888827630161920' AND feedId = '3700' AND wallId = '949'
这张桌子有10万多行。
最佳答案
尝试在筛选列上添加复合索引
ALTER TABLE `posts ` ADD INDEX `idx_posts` (`postId `, `feedId`, `wallId` );