# using filesort, bad thing here?

**URL:** https://forums.percona.com/t/using-filesort-bad-thing-here/600
**Category:** Other MySQL® Questions
**Created:** [January 16, 2008, 10:01pm UTC](https://forums.percona.com/t/using-filesort-bad-thing-here/600 "2008-01-16T22:01:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![imnotinsane](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@imnotinsane](https://forums.percona.com/u/imnotinsane)
#### Post date: [January 16, 2008, 10:01pm UTC](https://forums.percona.com/t/using-filesort-bad-thing-here/600/1 "2008-01-16T22:01:11Z")

</div>

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
