I have a query which selects hundreds of thousands of row and thus takes lot of time. When the user tries to interrupt it from the web page, the database server crashes. What is the safest way of handling this problem. Thanks for your solution.