sql-server-maintenance-solution icon indicating copy to clipboard operation
sql-server-maintenance-solution copied to clipboard

Set Deadlock_priority in the index/statistics job

Open DavidAMcL opened this issue 4 years ago • 2 comments

Description of the feature Please add an execution parameter to set deadlock_priority for all operations performed in the Index and Statistics Maintenance job. We would prefer to have this become a deadlock victim rather than a user or application session which is running at the same time, so we'd set it to a negative number.

Would this have any impact on other operations in the current execution of the Index and Statistics Maintenance job? The ideal situation for us would be to have preceding steps in the job succeed and to allow all operations following the deadlock to continue.

Hope this makes sense... Thanks.

DavidAMcL avatar Aug 23 '21 22:08 DavidAMcL

I would find this very usefull as well

keen85 avatar Nov 09 '21 20:11 keen85

I'm currently doing SET DEADLOCK_PRIORITY LOW; before calling the SP, but having that hardcoded in the SP would probably be good.

The index maintenance does proceed past the step that died on a deadlock in the current (2022-12-03) version.

It would be very nice to have an option to say "retry N times if failed due to deadlock" to try the index maintenance again. Perhaps @DeadlockRetries = 2 with default = 1? ...respect TimeLimit! :)

jhardin-accumula avatar May 03 '24 18:05 jhardin-accumula