After upgrading from SQL Server from 2012 to 2019 we have encountered problems with very simple delete query like:
DELETE [_sales].[OfferDetail] WHERE [OfferDetailsID]=@1
Operation takes about 15-30 seconds. When analyzing query plan there are nonclustered index scan, table spool and hash match operations that takes most of the time.
How can we optimize that query?
Query plan: https://www.brentozar.com/pastetheplan/?id=HyO1udXJn