运行查询
SELECT project, test_id, log_time,
connection_spec.client_geolocation.latitude,
connection_spec.client_geolocation.longitude
FROM m_lab.2012_11
GROUP BY project, test_id, log_time,
connection_spec.client_geolocation.latitude,
connection_spec.client_geolocation.longitude
ORDER BY log_time LIMIT 6
在约 20 秒内成功
但是,向其中添加 WHERE 子句应该会减少返回的行数
SELECT project, test_id, log_time,
connection_spec.client_geolocation.latitude,
connection_spec.client_geolocation.longitude
FROM m_lab.2012_11
WHERE log_time > 0
GROUP BY project, test_id, log_time,
connection_spec.client_geolocation.latitude,
connection_spec.client_geolocation.longitude
ORDER BY log_time LIMIT 6
导致错误“响应太大而无法返回”。
我的期望是限制返回的行会增加执行时间,因为需要扫描更多的行,但响应应该是相同的大小。我错过了什么?