Should select queries ever take longer than 1 second? I have select queries in my slow-log file that take 40-120 seconds.

When I consider something like a Google search, how fast that is, it makes me re-evaluate my entire database structure.

Since Google is literally searching billions of URLs in factions of a second, should I be worrying about 40 second queries?

# Query_time: 58.143590  Lock_time: 0.023085 Rows_sent: 3  Rows_examined: 1092421
use scrapers;
SET timestamp=1450286867;
SELECT * FROM `apps` WHERE dev_name = '' LIMIT 10;
Yes, you should be worried*. A simple query like this should be running in milliseconds and not examine a million rows.

My guess is that there are less than 10 rows that match the condition (evidence: Rows_sent: 3) and the lack of any index results in a full table scan (evidence: Rows_examined: 1092421). The explain output for the query would help us investigate if there is any other issue.

Good news is that a simple index on (dev_name) will probably solve the issue, for this query. Bad news is that you have to go through all the slow query, one by one, run explain on them, examine the tables and their indexes and either rewrite the queries or add appropriate indexes.



*: Of course, not because Google searches are fast. Any comparison between the super farms that a giant company uses and a single server is moot.