or download this
ALTER TABLE tablename ADD INDEX(line_n);
ALTER TABLE tablename ADD INDEX(word_position);
ALTER TABLE tablename ADD INDEX(line_n,word_position);
SELECT word FROM tablename USE INDEX(line_n,word_position) ORDER BY (l
+ine_n*100+word_position) ASC;