Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Linked server query performance Expand / Collapse
Author
Message
Posted Monday, December 24, 2012 2:31 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, November 26, 2014 8:03 AM
Points: 19, Visits: 79
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


Post #1399992
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse