Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 distributed parallel query

Author  Topic 

aliobaidi
Starting Member

2 Posts

Posted - 2010-08-23 : 23:55:04
I have a query that looks like this

select * from S1.table1
union all
select * from S2.table2

S1 is remote server 1, S2 is remote server 2
I am running the query from my local server and have a link with both S1 and S2

If I run the first query alone then it will get executed in 23 s
for S2 it will take 34 sec. If I run them with the union all, it takes 51 sec. I was expecting it to take 34 sec but it seems that the queries are running serially rather than parallel.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-24 : 03:55:38
Yes that is correct, it is serial. If you want it to be parallel, I suppose you would need to create two threads in your applications and then pull them all together in the end.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

aliobaidi
Starting Member

2 Posts

Posted - 2010-08-24 : 17:29:10
Tara,

I am interested in getting the output from the union through SQL query with minimal or No programming
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-24 : 18:10:32
Then you are stuck with the current performance.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -