Home » RDBMS Server » Performance Tuning » union in one go (oracle 10g)
union in one go [message #481170] Mon, 01 November 2010 08:47 Go to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
I have one query like

a--query1
union
b--query2
union
c--query3

and get the output in 30 seconds.
If i run the separte seprate query it took 10 seconds each. Now my question is that can i run all the three query spearetly in one process, so that in 10 seconds i can get thecombined output. Please advice.
Re: union in one go [message #481172 is a reply to message #481170] Mon, 01 November 2010 08:58 Go to previous messageGo to next message
cookiemonster
Messages: 13958
Registered: September 2008
Location: Rainy Manchester
Senior Member
Not really no.
Do you realise that UNION does an implicit distinct on the result?
Your question would imply that such a distinct operation is unecessary with your queries. In which case you should use UNION ALL instead.
Re: union in one go [message #481173 is a reply to message #481172] Mon, 01 November 2010 09:12 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
no ,its my mistake, actually its union all in every query and give different results , now i want to run in serprate and them combined.
Re: union in one go [message #481174 is a reply to message #481173] Mon, 01 November 2010 09:13 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>now i want to run in serprate and them combined.
Nobody here is preventing you from doing so.

Post results after successful completion.

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: union in one go [message #481176 is a reply to message #481174] Mon, 01 November 2010 09:23 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
No i want to insert the output of each query seprately,means in parralel,because if i run it one go, it took 30 seconds, but if i run it every query one by one, it took 10 seconds, so finally i want to get the output in 10 seconds, is there any way.
Re: union in one go [message #481185 is a reply to message #481176] Mon, 01 November 2010 11:14 Go to previous message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
So use UNION ALL and parallel insert.

Regards
Michel

[Updated on: Mon, 01 November 2010 11:14]

Report message to a moderator

Previous Topic: Required tool for SQL Query
Next Topic: Query
Goto Forum:
  


Current Time: Fri Nov 22 07:05:41 CST 2024