SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Linked server query performance


Linked server query performance

Author
Message
Dimitrije Mišic
Dimitrije Mišic
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 80
Hello, not really sure if this is the right part of the forum for this question but I have a strange performance problem.

I have two structurally identical databases one on main server and one on express edition standalone machine connected over VPN
this query is run on the standalone machine linked server is the main server
table1 is around 10 million rows on central server and around 100k rows on local server.

INSERT INTO [linkedsrv].MyDB.dbo.table1 (col1, col2,..)
SELECT col1, col2,.. from table1 a WHERE timestamptable >= olddbts and timestamtable < newdbts
AND NOT EXISTS (SELECT 1 FROM [linkedsrv].MyDB.dbo.table1 WHERe pk1=a.pk1 AND pk2=a.pk2 and pk3=a.pk3 and pk4=a.pk4)

pk1 trough pk4 are the complete primary key of table1
timestamptable >= olddbts and timestamtable < newdbts usually limits the number of rows to 500 - 2000.

the performance monitor chose the nested loops left anti semi join.
with the network latency of about 8ms I get very poor results.
(for every row of local table it calls the linked table)
Should I use join hints?
If so which would be best? Merge / Hash
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search