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


PREEMPTIVE_OLEDBOPS cause of slow down remote query


PREEMPTIVE_OLEDBOPS cause of slow down remote query

Author
Message
spidey73
spidey73
SSC-Enthusiastic
SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)SSC-Enthusiastic (136 reputation)

Group: General Forum Members
Points: 136 Visits: 447
I've got two machines:
Server A: SQL 2008: contains the database on which the query is executed.
Server B: SQL 2005: the server from which the query is executed,

When I execute the query directly on Server A, it takes 7 seconds to complete.
Executed on Server B, it will complete in 2,5 minutes.

When I monitored it simply in the activity monitor (on server B), I saw a lot of PREEMPTIVE_OLEDBOPS waits alternating ODBC waits.

Does anyone know where to look for the bottleneck?
I presume it's got something to do with the connection between server B to Server A.
Ken McKelvey
Ken McKelvey
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4111 Visits: 8444
spidey73 (1/26/2011)
I've got two machines:
Server A: SQL 2008: contains the database on which the query is executed.
Server B: SQL 2005: the server from which the query is executed,

When I execute the query directly on Server A, it takes 7 seconds to complete.
Executed on Server B, it will complete in 2,5 minutes.

When I monitored it simply in the activity monitor (on server B), I saw a lot of PREEMPTIVE_OLEDBOPS waits alternating ODBC waits.

Does anyone know where to look for the bottleneck?
I presume it's got something to do with the connection between server B to Server A.



You are probably using the four part naming convention to run the remote query. This will pull back all the data from Server A and filter it on Server B. You should use OPENQUERY() as this will filter on Server A and only return the results.
tfifield
tfifield
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2521 Visits: 2890
Another easy way to handle this is create a stored procedure for the query on the remote server. Then execute it from the local server using the 4-part procedure name. All filtering and such will take place on the remote server and you'll only get back the results.
Todd Fifield
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