File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Long Query execution time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Long Query execution time" Watch "Long Query execution time" New topic

Long Query execution time

Manigandan Velraj

Joined: Nov 30, 2009
Posts: 14

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.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3749

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.

[OCA 8 Book] [Blog]
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32819

Can you post the query here? Maybe it can be tuned. Or maybe you can do it in 4 pieces. Or maybe there will be other ideas.

As far as what to do if it must take a long time, see user notification messages.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Long Query execution time
It's not a secret anymore!