MySQL Forums
Forum List  »  MyISAM

myisamchk --sort-index
Posted by: Ron Last
Date: January 14, 2014 09:00AM

I have a MyISAM table with 100 million records which I join to other tables with a unique key. Will using the sort index option (see below) improve the join performance by much?

myisamchk --sort-index --sort-records=1 myTable

I also regularly use a WHERE statement on another indexed field that only has 20 possible values so I am wondering if I should sort on this fields.

Below is a typical query
SELECT .... FROM X JOIN Y USING(ID) WHERE X.theYear=2012
Should my table be sorted on ID or theYear for best performance.
Maybe the answer is obvious, or maybe it is data dependent, would appreciate comments.
thanks

Options: ReplyQuote


Subject
Views
Written By
Posted
myisamchk --sort-index
3221
January 14, 2014 09:00AM
2118
January 15, 2014 11:41AM
1962
January 16, 2014 02:58AM
1828
January 16, 2014 11:15PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.