I am developing a search page which searches oracle DB where i have a oracle select query which has 4 unions. Some queries takes 25 secs to execute some queries. When the user clicks search button i get "Internal server error (page cannot be displayed)" some times. instead i need to show the users some message. i tried all possible query tuning.
I want to either increase the browser response time / if the response takes long time, display a message. please help me in this regard.
Unions are generally very poor query operators and should be avoided at all costs. As for general query performance, you should consider indices to improve performance as well as db tuning wizards.