Sunday, November 11, 2007

Bad designed query made the whole system stop responding

It is bit boring this weekend coz I didn't arrange any thing to do and just stayed at home.
Anyway, Last friday, I was contacted by our helpdesk that our whole ERP system stop responding and everyone couldn't do anything on the system but wait. By running a check one the database, it turned out to be a query some ran causing the problem. I was bit confused initially coz the query was run from the application server. well, when I logoned to the app server later, I found out that one of my colleague was right there!
he was running a query to update one of the main table. the worst thing is, the query was made of 4 joins among 5 main tables and each of them is used intensively and contains hundreds of thousands of rows!
I believed that in such a situation, a 4 tables join is probably not a good option and can definitely cause big problem.

No comments: