在使用Laravel构建的OctoberCMS网站中的此查询。执行大约需要580毫秒!有什么问题吗?以及如何加快速度?
SELECT *
FROM system_files
WHERE system_files.attachment_type = 'Me\Articles\Models\Article'
AND system_files.attachment_id = '235017'
AND field = 'image'
AND system_files.attachment_id IS NOT NULL
ORDER BY sort_order ASC
LIMIT 1
该表大约有220,000条记录,这些是表上的索引:
field
attachment_id
attachment_type