我有以下查询:
SELECT * FROM `title_mediaasset`
WHERE upload_id is not null
ORDER BY `upload_date` DESC
它需要将近一秒钟并且不使用索引:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE title_mediaasset ALL upload_id,upload_id_2 NULL NULL NULL 119216 Using where; Using filesort
如何改进此查询?
该表包含大约 100k 个结果,明年可能会增加到 100 万个。