You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer using MySQL to make a query perform better I might want to use the FORCE INDEX syntax to ensure MySQL won't use a table scan to query my table.
Example:
var myQuery = dbContext.Set<User>()
.ForceIndex("IX_User_CreatedDate")
.Where(user => user.CreatedDate > DateTime.UtcNow());
If I had a way to extend the query providers underneath, I could write my own IQueryable extension method that would enable me to do this, but as it stands, I can't.
Is there any guidance as how could I achieve this?
I'm trying to get this done through interception but I can't figure out how to get the Expressions connected with the interception for this, and almost everything I look into is marked as "Internal API" so it seems a bit unsafe to get it done this way.
Activity
smitpatel commentedon Jun 11, 2019
@neoaisac - Can you write what would be the SQL generated for such query?
neoaisac commentedon Jun 11, 2019
It would be similar to...
neoaisac commentedon Jun 11, 2019
I'm trying to get this done through interception but I can't figure out how to get the Expressions connected with the interception for this, and almost everything I look into is marked as "Internal API" so it seems a bit unsafe to get it done this way.
smitpatel commentedon Jun 11, 2019
Duplicate of #6717