Yes, you can do it. It is tough to say if it will help performance or not. For example if you are cpu bound it probably won't. You should write some test code. Actually before you do that you should profile your current code and see where the bottleneck is and see where that leads you.
It is tough to say if it will help performance or not.
I am surprised by your answer , why is that you were mentioning that it may not improve performance .
Could you please tell me why it will not improve performance if we use Threads parallelly for query processing .
Thanks in advance .
Save India From Corruption - Anna Hazare.
Joined: Jun 26, 2002
Because it may not be your bottleneck (part of your program that is slow). For example say the database is 100% cpu pegged while running one query. Adding a 2nd query to an already overloaded server would make performance worse. This is just one example any other number of reasons could make such a change ineffective. The key with performance tuning is ALWAYS to know what you're bottleneck is before trying to tune. We could better help you if you posted some of your performance numbers for different parts of your code.
The solution already built by Oracle will very probably perform much better than any code outside of the database, avoiding many serious problems you would have to solve (How to partition the query into two or more equally sized parts? How to make sure the returned resultsets are consistent with each other? etc). Oracle can do all this easily as it has all information it needs at hand.
However, as Steve hinted, the basic question is whether the parallel processing can actually help in your case. It is quite advanced concept and your reaction to Steve's answer indicates you're not very familiar with the subject. I'd discourage you to go that path unless you understand it really thoroughly. In any case, if it later turns out that you really can utilize the parallel processing, it can easily be added to your code by slight modifications of the SQL statement(s) and/or schema tables, without any need to modify the Java code itself.