MySQL使用文件排序和查询非常慢?

MySQL使用文件排序和查询非常慢?,mysql,Mysql,我有一个问题: SELECT listings.*, listingagents.agentid FROM listings LEFT JOIN listingagents ON (listingagents.id = listings.listingagentid) LEFT JOIN ignore ON (ignore.system_key = listings.listingid) WHERE ignore.id IS NULL ORDER BY listings.id ASC 我正试图

我有一个问题:

SELECT listings.*, listingagents.agentid
FROM listings
LEFT JOIN listingagents ON (listingagents.id = listings.listingagentid)
LEFT JOIN ignore ON (ignore.system_key = listings.listingid)
WHERE ignore.id IS NULL
ORDER BY listings.id ASC
我正试图提高这个查询的性能,因为它非常慢,而且会给MySQL服务器带来沉重的负载

当我进行mysql解释时,输出显示:

+--------+-------------+---------------+--------+---------------+------------+---------+----------------------------+--------+-------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +--------+-------------+---------------+--------+---------------+------------+---------+----------------------------+--------+-------------------------+ | 1 | SIMPLE | listings | ALL | NULL | NULL | NULL | NULL | 383360 | Using filesort | | 1 | SIMPLE | listingagents | eq_ref | PRIMARY | PRIMARY | 4 | db.listings.listingagen... | 1 | | | 1 | SIMPLE | ignore | ref | system_key | system_key | 1 | const | 404 | Using where; Not exists | +--------+-------------+---------------+--------+---------------+------------+---------+----------------------------+--------+-------------------------+ 该查询还包含“使用文件排序;”

字段“listings.id”、“listingagents.id”和“ignore.id”是主键 字段“listingagents.id”和“ignore.system_key”具有索引


如何改进第一个查询?

尝试通过添加一些条件来减少列表范围(当前为383360行)。e、 g.id>x或限制

如果您对“按id从列表中选择*顺序asc”执行“描述”,会发生什么情况?
SELECT listings.*
FROM listings
ORDER BY listings.id ASC