aspose file tools*
The moose likes Oracle/OAS and the fly likes How to optimize the below query to give fast results Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "How to optimize the below query to give fast results" Watch "How to optimize the below query to give fast results" New topic
Author

How to optimize the below query to give fast results

A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
Hi Friends,

I am not good at DB side, so i would like to take your help. Below query taking so much time to featch the results. Can anyone show me the solution about how to optimise it.

Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
What does this mean? "PUB.PUBLSEQ LIKE '%%%%%J'"
and what is the difference from this? "PUB.PUBLSEQ LIKE '%J'"

You can use only one "%" that means any and many times. You don't need to repeat it. It is not wrong but looks weird.

For optimizing your query:
1) take an explain plan for your query and focus on high costs and full table accesses.
2) using functions on where clause prevents index usage, if function usage is dispensable get rid of it.
3) adding indexes on columns used for joins may help, but it should be analyzed. Query optimization and sql tuning does not mean adding index on all join columns. A dba may help you on index analysis.

Regards,
Fatih.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to optimize the below query to give fast results