Advertisement

12.07.2004 at 07:04AM PST, ID: 21233329
[x]
Attachment Details

Querying server and linked server performance

Asked by auke_t in MS SQL Server

Tags: , ,

Hi,

I've got a stored procedure which joined some local tables with one table on a linked server, which returns an average of 100 records.
It worked quite nice and quite fast (less then a second to execute), but after the server was updated something strange happened. Half of the time it would perform as it did before, but the other half it would take 10 seconds or more.

When I looked at the trace on the local server there was no difference (except for the execution time), but on the linked server the fast variant executed a procedure for each of the results.

I used sp_recompile on the procedure and since then it always takes 10 seconds or more to execute.

I think the fast method joined the local tables first and then got the data it needed from the linked server.
The slow method probably joins the whole linked server table.

How can I force sqlserver to use the fast method?

Local Server = SQL 2000
Linked Server = SQL 7.0

Hope you can help,

AukeStart Free Trial
[+][-]12.07.2004 at 08:00AM PST, ID: 12765107

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.08.2004 at 02:50AM PST, ID: 12772068

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.08.2004 at 03:07AM PST, ID: 12772143

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.08.2004 at 06:05AM PST, ID: 12773280

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]12.12.2004 at 01:54AM PST, ID: 12803322

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: server, linked, performance
Sign Up Now!
Solution Provided By: modulo
Participating Experts: 2
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32