hi,
i have this table:
TABLE messages
id_usr, id_usuario, message, date
PRIMARY (id_usr, id_usuario, date)
the querys over this table will be always like this:
EXPLAIN SELECT *
FROM `messages`
WHERE (
id_usr =1
AND id_usuario =2
)
OR (
id_usr =2
AND id_usuario =1
)
ORDER BY date
LIMIT 0 , 30
that shows me:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE messages range PRIMARY PRIMARY 8 NULL 13 Using where; Using filesort
so it uses filesort, which is a bad thing, but my question is, in this case, considering that there will be at most 100 rows as response, is really important the filesort issue?
is there any other way to do that better ?
thanks a lot
i have this table:
TABLE messages
id_usr, id_usuario, message, date
PRIMARY (id_usr, id_usuario, date)
the querys over this table will be always like this:
EXPLAIN SELECT *
FROM `messages`
WHERE (
id_usr =1
AND id_usuario =2
)
OR (
id_usr =2
AND id_usuario =1
)
ORDER BY date
LIMIT 0 , 30
that shows me:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE messages range PRIMARY PRIMARY 8 NULL 13 Using where; Using filesort
so it uses filesort, which is a bad thing, but my question is, in this case, considering that there will be at most 100 rows as response, is really important the filesort issue?
is there any other way to do that better ?
thanks a lot