A reader asks:
Hiya Ray -
Is there any guidelines as to how long a query should take to process? For example, I have a category column that I have return just 10 rows, but my entire database has 60,000+ records and it takes about 1100ms. Is this bad?
It depends. (Tired of me saying that yet? ;) I'd always be wary of saying, "A query should only take X seconds," but I can say 1100 ms is probably way too much. I am not a good DBA. It is something I'm working on improving. But I'd definitely recommend looking into your SQL and trying to figure out why it is taking so long. If you want (and if you still read this blog after I took so long to respond), you can post your code and my readers and I can help debug it.
So what would I use as a general suggestion for the maximum amount of time a query should take? I'd say anything over 50ms should be cause for alarm. (Well, not alarm, but I'd check it out.)
By the way - Starfish can help you check how long your queries are taking.