I have speed problems with a MySQL query. The tables definitions are as follows:
CREATE TABLE IF NOT EXISTS `student` (
`student_id` int(11) unsigned NOT NULL
Try index:
KEY student_sort(countup DESC ,updated_time DESC)
Then use STRAIGHT_JOIN and FORCE INDEX:
SELECT *
FROM student force index(student_sort) STRAIGHT_JOIN
college
ON student.student_college = college.college_id
WHERE college_location = 1
ORDER BY student.countup desc,
student.updated_time desc
LIMIT 15;