Query processor could not produce a query plan because of the hints defined in this query. Resubmit the query without specifying any hints and without using SET FORCEPLAN
Can anyone tell me the best way to diagnose the error?
I ran into the same problem you are having a few weeks back. When selecting ‘Recurring Jobs’ dashboard item, it appears that HangFire is performing a FORCESEEK (I cannot remember if this is the exact hint). I initially thought it had to do with missing unique key references on the [HangFire].[Hash] table however, setting the [Key] field of the [Hangfire].[Hash] table to NVARCHAR(100) resolved this issue.
I am still looking into exactly why this is causing a problem but I hope that this solution will help resolve your problem.
What version of Hangfire are you using? I recently upgraded to v.1.5.2 and had similar issues which required me to added specific nonclustered indexes and make most of the NVARCHAR fileds that I converted to VARCHAR back to NVARCHAR…
To give you some context, I manage the HangFire schema manually in order to publish my database project with a db_owner and run my application as a db_read db_write. With this in mind, make sure to have the ‘prepareHangfireSchemaIfNecessary’ set to false on application start. This is a sqlServerStorageOptions property.
Take a look at the Hangfire source code Install.sql and make sure your schema contains the unique nonclustered indexes that are present in this script file. Also check to see if there are other fields within the Hangfire schema that is VARCHAR and change them one at a time to NVARCHAR. Adding the UNCI and change my fields back to NVARCHAR resolved this issue.