We are having performance issues due to parameter sniffing in SQL Server. Our application uses NHibernate with the LINQ provider.
I am searching for a way to add for example "OPTION(RECOMPILE)" to that certain SQL query. I now I could use interceptors for that, but I want it to be added only to certain IQueryable queries. So not on all my nhibernate queries, because then I would lose the advantages of query plan caching.
Other options to solve the parameter sniffing on 1 specific query with NHibernate are also welcome.