An idea to optimize this code

Plan.pesession (78.7 kB)
avatar image By Abel BIYIHA 0 asked Dec 16, 2015 at 04:05 PM
more ▼
(comments are locked)
10|10000 characters needed characters left

1 answer: sort voted first

What is the data type of the @Mode parameter and the data type of the Mode column in local_bmsampleResults? Why don't these match? The most expensive statement in the session contains an index scan which may not need to be a scan except for the implicit conversion of the column to nvarchar(20). So the first thing I would do is to ensure those match. Next, this whole plan seems to have run in 0.003 seconds - how much faster do you expect it to be, especially since you are updating 7 non-clustered indexes (and that's only in the single statement I've already mentioned)?

avatar image By Aaron Bertrand ♦ 1.7k answered Dec 28, 2015 at 04:05 PM
more ▼
(comments are locked)
10|10000 characters needed characters left
Your answer
toggle preview:

Up to 50 attachments (including images) can be used with a maximum of 209.7 MB each and 209.7 MB total.

Follow this question

Topics:

x641
x166
x20

asked: Dec 16, 2015 at 04:05 PM

Seen: 142 times

Last Updated: Jan 03, 2016 at 10:54 AM