EXPLAIN EXTENDED SELECT SQL_CALC_FOUND_ROWS SQL_NO_CACHE g.*, u.user_id FROM geotable g JOIN userstable u ON g.uid = u.uid
-- corners selection:
WHERE (lat BETWEEN ? and ? AND lon BETWEEN ? and ?) ORDER BY time ASC;
volta com
+----+-------------+------------+--------+---------------------+---------+---------+----------------+--------+----------+----------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+------------+--------+---------------------+---------+---------+----------------+--------+----------+----------------+
| 1 | PRIMARY | g | ALL | uk_uid,lat_lon_time | NULL | NULL | NULL | 199917 | 2.15 | Using filesort |
| 9 | DERIVED | u | eq_ref | PRIMARY | PRIMARY | 4 | tigasedb.g.uid | 1 | 100.00 | |
+----+-------------+------------+--------+---------------------+---------+---------+----------------+--------+----------+----------------+
Há uma chave nas colunas (lat, lon, time) nesta ordem. Existe uma maneira de convencer o MySQL a usá-lo para esta consulta?