The query is complex and returns 16,000 out of 240,000 rows. Proper indexes are used and the query is relatively fast however it always uses temp tables and filesort. I am trying to speed it up though. When I do an explain I get:
[tt]
+--------+------+---------------+-------+---------+------------+-------+---------------------------------------------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+--------+------+---------------+-------+---------+------------+-------+---------------------------------------------+
| p | ref | x_mfl | x_mfl | 1 | const | 15889 | where used; Using temporary; Using filesort |
| t5 | ref | pav | pav | 5 | p.id,const | 1 | where used; Using index |
| t6 | ref | pav | pav | 5 | p.id,const | 1 | where used; Using index |
| t33 | ref | pav | pav | 5 | p.id,const | 1 | where used; Using index |
| t56 | ref | pav | pav | 5 | p.id,const | 1 | where used; Using index |
| sorder | ref | pav | pav | 5 | p.id,const | 1 | Using index |
+--------+------+---------------+-------+---------+------------+-------+---------------------------------------------+
[/tt]
Its a MyISAM table and I am running MySQL 3.23 on FreeBSD. The system has 1.5 gigs of ram. I am guessing its a startup variable that needs tweeking to allocate more memory but an not certain to too which one...
[tt]
+--------+------+---------------+-------+---------+------------+-------+---------------------------------------------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+--------+------+---------------+-------+---------+------------+-------+---------------------------------------------+
| p | ref | x_mfl | x_mfl | 1 | const | 15889 | where used; Using temporary; Using filesort |
| t5 | ref | pav | pav | 5 | p.id,const | 1 | where used; Using index |
| t6 | ref | pav | pav | 5 | p.id,const | 1 | where used; Using index |
| t33 | ref | pav | pav | 5 | p.id,const | 1 | where used; Using index |
| t56 | ref | pav | pav | 5 | p.id,const | 1 | where used; Using index |
| sorder | ref | pav | pav | 5 | p.id,const | 1 | Using index |
+--------+------+---------------+-------+---------+------------+-------+---------------------------------------------+
[/tt]
Its a MyISAM table and I am running MySQL 3.23 on FreeBSD. The system has 1.5 gigs of ram. I am guessing its a startup variable that needs tweeking to allocate more memory but an not certain to too which one...