Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


query data using linked server


query data using linked server

Author
Message
HBK_4700
HBK_4700
Old Hand
Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)Old Hand (364 reputation)

Group: General Forum Members
Points: 364 Visits: 1821
HI,

Linked servers in test environment working differently than prod. Not sure what is causing slowness in test environment? is this issue with SQL version? Please advise.

Test ServerA – SQL 2000 dev edition 8.00.2055 (X86), Windows NT 5.2 (Build 3790 SP2)
TestServerB -- SQL 2000 std edition 8.00.2055 (X86), Windows NT 5.2 (Build 3790 SP2)

Linked server exists between TestServerA and Test ServerB (also vice versa)


ProdServerA-- SQL 2000 EE edition 8.00.2187 (X86), Windows NT 5.2 (Build 3790 SP2)
ProdServerB-- SQL 2000 EE edition 8.00.2055 (X86), Windows NT 5.2 (Build 3790 SP2)

Linked server exists between ProdServerA and ProdServerB (also vice versa)


Pulling data from ProdServerA to ProdServerB:
• Estimated Execution Plan shows an Inner Join being used.
• Runs quickly.

Pulling data Test ServerA to TestServerB :
• Estimated Execution Plan shows a Hash Join being used.
• Very slow due to Hash. Trying to bring entire source table of rows across.

TestServerB -Is setup with linked server to TestServerA.
TestServerA on this server has system tables named SysRemote_...

TestServerA Is setup with linked server to TestServerB
TestServerB on this server does NOT have system tables named SysRemote_...


Here’s the query:
SELECT
rp.ReadID,
rp.ReadPositionIndex,
rp.ConvertedValue,
rp.LaserPower,
rp.LaserDuration,
rp.Counts,
rp.CalibrationID,
rp.GlowCurveData
FROM
-- To run on ProdServerB (Production)
TableB arp
JOIN ProdServerA.DatabaseA.dbo.TableA rp ON arp.ReadID = rp.ReadID AND
arp.ReadPositionIndex = rp.ReadPositionIndex

-- To run on TestServerB (Test)
-- JOIN TestServerA.DatabaseA.dbo.TableA rp ON arp.ReadID = rp.ReadID
-- AND arp.ReadPositionIndex = rp.ReadPositionIndex
Stuart Davies
Stuart Davies
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4512 Visits: 4555
Hi - it might be worth checking what other software you have installed on your Dev server - is the hardware the same spec and so on. Otherwise you won't be doing a fair comparison.

-------------------------------
Posting Data Etiquette - Jeff Moden
Smart way to ask a question

There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
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