1

I have a query that includes accessing a table via linked server. When it runs it's doing so without parallelism. But if I comment out the join to the linked server table it runs with parallelism and completes almost instantly.

The row count of the table accessed by the linked server is 2m.

Could the linked server be causing the query to run without parallelism?

Here is the plan.

asked May 24, 2018 at 12:41
0

2 Answers 2

4

Joining to a table via a Linked Server is problematic. You can workaround the issue by pulling the required rows from the remote table into a local #temp table, and JOINing against that #temp table instead.

answered May 24, 2018 at 12:49
0
1

From comments:

The easiest way to start troubleshooting this is to add OPTION(USE HINT('ENABLE_PARALLEL_PLAN_PREFERENCE')) to the query that isn't going parallel. It could be a cost based decision. It's not included in the XML you provided, but there may be a NonParallelPlanReason in the XML if there's an optimizer limitation involved. - Erik Darling

answered Nov 4, 2020 at 21:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.