Query execution involving two servers in SQL server , is really slow I am running the following query , and it takes over 1 hour to finish execution. As there are so many joins and then one union is involved, is it normal for this query to be executed in 1 hour, or is it because of bringing result from two different servers ? In fact , there is one procedure , involving this select statement , creation of the procedure also took very long.

select reg.Associateid,reg.Companyid,Sum(Componentvalue) Componentvalue 
from CTSINTCOSMYPT.IndiaPayrollDB_LiveFinance0910.pr.salaryregister reg
join [MP].[SuperannuationFundStatementTemplateUploadTemp] SAPrev  
on reg.Associateid=SAPrev.Associateid and reg.Companyid=SAPrev.Companyid
join CTSINTCOSMYPT.IndiaPayrollDB_LiveFinance0910.pr.associatemonthlysalreimb  salreimb 
on reg.Registerid=salreimb.Registerid
where Componentid=12 and ComponentValue&gt;0 
Group by reg.Associateid,reg.Companyid 
Union all
select reg.Associateid,reg.Companyid,Sum(Componentvalue) Componentvalue 
from CTSINTCOSMYPT.IndiaPayrollDB_LiveFinance0910.pr.salaryregister reg
join [MP].[SuperannuationFundStatementTemplateUploadTemp] SAPrev  
on reg.Associateid=SAPrev.Associateid and reg.Companyid=SAPrev.Companyid
join CTSINTCOSMYPT.IndiaPayrollDB_LiveFinance0910.pr.associatemonthlyarrreimb  salreimb 
on reg.Registerid=salreimb.Registerid
where Componentid=12 and ComponentValue&gt;0 
Group by reg.Associateid,reg.Companyid
Yes you're right, joins across linked servers is slow. A simple but unflattering solve is to pull the data across from each table on other servers and insert it into a temp table (select a,b,c into #temp from server.database.schema.table) or table variable. Then use that table in your queries. A better way would be to design an ETL to periodically pull these tables onto a single server.