Skip to content

Request to add support for OPTION (RECOMPILE) #36439

Closed as duplicate
Closed as duplicate

Description

@chenghehe

What problem are you trying to solve?

I encountered slow linked table queries in the project and eventually discovered that it was caused by parameter sniffing. I didn't want to write native SQL or stored procedures, so I tried many ways but couldn't solve the problem. I added OPTION (RECOMPILE) at the end of the SQL generated by efcore to solve the problem, and changed the parameters generated by efcore to local variables. I hope to add a query hint

Describe the solution you'd like

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions