Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The article and the comments here don't make it clear why running it in production shouldn't be done. If slow_query is already running in production, why would running EXPLAIN ANALYZE slow_query be bad?

Is the overhead of running EXPLAIN ANALYZE so much worse than running slow_query itself?



No, it's really not, and that's why I say it must sometimes be done. Certainly if you're running tens or hundreds of copies of the query per minute, one more won't hurt (much).

The real problem you run into is when the query in question is doing something pathologically bad - locking a bunch of tables and then grinding away for an hour, which effectively is a denial of service attack.


one thing to consider is the person who needs to run explain analyze may not have any access whatsoever to the production database. Also, there may be no process in place to get someone to run it on prod on their behalf. Finally, if there is a DBA on production they may just say no.


One reason you might not want to run it in production is if it's not a read-only query.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: