Which fields should be indexed to speed up the following query?
SELECT *
FROM sms_report
WHERE R_uid = '159'
AND R_show = '1'
ORDER BY R_timestamp DESC , R_numbers
Which fields should be indexed to speed up the following query?
SELECT *
FROM sms_report
WHERE R_uid = '159'
AND R_show = '1'
ORDER BY R_timestamp DESC , R_numbers
Basing on this information, a composite index on (R_uid, R_show) should be good.
http://dev.mysql.com/doc/refman/5.5/en/multiple-column-indexes.html
To be able to tell anything more, you'd need to show us results of EXPLAIN
http://dev.mysql.com/doc/refman/5.5/en/explain.html
and tell which storage engine is being used.