Edit based on comments from spencer7593 and Martin:
A simple count + select query might be much faster than one SQL_CALC_FOUND_ROWS. see:
Which is fastest? SELECT SQL_CALC_FOUND_ROWS FROM `table`, or SELECT COUNT(*)
I suggest running both your original query and:
SELECT count(*)
FROM `logs`
WHERE `connect_timestamp` > 10000
plus:
SELECT `a`
FROM `logs`
WHERE `connect_timestamp` > 10000
ORDER BY `connect_timestamp` DESC
LIMIT 1
Best even to run all with EXPLAIN added to measure (and add) the runtimes and see the difference, you can also add SQL_NO_CACHE to simulate a first run. see: https://www.percona.com/blog/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/
If that doesn't help at all i suggest to look into the following:
Things you can try:
- Index the column which is used for searching (you seem to have already done so)
- Make a view for specific queries that are to be executed often.
- Try caching the specific table if the server has memory for it.
- Also like Martin said in the comments, Put EXPLAIN in front of the query to see which part of the query is taking up all the time. Maybe there is something you can change about it.
Those are the things i can come up with.