Таблица:
Id int, date date, number int, ip varchar (int невозможно из-за точек)
Primary key - id, number.
Количество строк в таблице ~ 8.000.000.
Необходимо оптимизировать под запрос (подсказан здесь):
select t1.*, t2 from table t1, table t2
where t1.number = значение
and t1.number <> t2.number
and t1.date = t2.date
and t1.ip = t2.ip
explain:
ID| select_type| table| type| possible_keys| key | key_len| ref| rows| Extra
1| SIMPLE| t1| ALL| (null)| (null)| (null)| (null)| 8029425| Using where
1| SIMPLE| t2| ALL| (null)| (null)| (null)| (null)| 8029425| Using where; Using join buffer (Block Nested Loop)
Помогите с решением
explain
для вашего запроса.