Oracle query using Entity Framework is ridiculously slow
Wrap your input parameter with EntityFunctions.AsNonUnicode(memberId)
.
var member = (from m in context.Members where m.MemberID.Equals(EntityFunctions.AsNonUnicode(memberId), StringComparison.OrdinalIgnoreCase) select m).FirstOrDefault();
We had a similar performance issue. Thanks @CameronP for the suggestion to use the EntityFunctions.AsNonUnicode, which fixed the performance issue. Our project uses EF6 with Oracle 12.1* Managed Data Access. Instead of making the change to every EF query parameter, we used the TypeName attribute on the Entity Model and it worked !
Public Class Table1 <Column("COLUMN_1", TypeName:="VARCHAR2")> Public Property Column1 As StringEnd Class
An other solution is to update your oracle provider!Odac 12c fix this problem : https://community.oracle.com/message/11065799#11065799
It will prevent you from changing all your query with EntityFunctions.AsNonUnicode()