Why Parallel
sajan perumpalli, September 28, 2017 - 4:44 pm UTC
This procedure will be called from a .Net application. There will be couple of procedures in this main procedure before the procedures that needs to run parallel. This is a kind of search procedure. Where it needs to search in multiple tables and bring back the results and provide back to .net application.
Individual procs are faster but for now i need to search only 3 places. In future there could be 6 tables. So i need to make them parallel and needs to wait for all the procs to be completed.
September 28, 2017 - 4:58 pm UTC
OK. But I still don't understand why you need to do these in parallel?
And why do these need to be separate queries in the first place? Can you join the tables and return everything in one select?
system level option
A reader, September 29, 2017 - 6:56 am UTC
In unix you can use the & operator to parallelize.
Don't know .net if permit such thing
September 29, 2017 - 12:27 pm UTC
I don't see how that would help here...
Why Parallel
sajan perumpalli, September 29, 2017 - 2:11 pm UTC
They are different life cycle of a of a same transaction.
for example: you bought an item from walmart.
1. Item came from china in a frieght
2. It was stocked in a warehouse
3. From warehouse it came to store on truck.
4. Someone stocked it in aisle.
5. Item Purchased
All these 5 things will be probably in 5 systems. I bought all the necessary data from different systems into one system. Now i want to search a item. I want to know the movement of the item for various reasons. This is not my scenario but i have similar one.
Possible Solutions
------------------
1. Make 5 different calls from .net. Drawback is u need to make 5 calls to db and if they are api calls, u need to authenticate authorize each of them.
2. Make one call to db and db handle all the parallel search.
I am trying for the second option.
October 02, 2017 - 9:16 pm UTC
Thanks for the background. I still don't understand why when using option 2 this needs to be in parallel?
Precisely what is the problem you're having by running these steps serially? Be specific!
And why do you need separate queries? If all the data is in on DB, why can't use get it all in a single select?
Back to basics ....
B C, September 29, 2017 - 2:29 pm UTC
Looks like you want to run x queries and want it to happen in parallel so that you get all results at the same time.
Now, using multiple processes running in parallel would be a overkill, because not only would you need to do a diy process manager, it simply would not be efficient.
Assuming all your data is in one database, you could run multiple queries and use basic sql operators like union / union all / intersect etc ...
If you code these correctly, you should have no issue getting the resultset back in an acceptable time range.
Best place to start is at
https://docs.oracle.com/cloud/latest/db112/CNCPT/toc.htm Good Luck !!
October 02, 2017 - 9:20 pm UTC
Yeah, combining the queries into one seems the way to go to me...