I am using Oracle 11G and the highest Oracle 11G supported version of Entity framework EF5 in a .NET 4.5 MVC web api. Also using the latest ODAC Oracle.DataAccess dll.
So far we are deep into a project with these technologies and in our dev environment things are working pretty well.
The problems began to appear as we began using larger test databases. We have isolated the issue in the resulting queries where there is a lot of CASTING going on.
For example:
CAST("Extent10"."TAX_ID" AS number(10,0))))
The thing is TAX_ID
already is a number(10,0)
! The cast is not needed and is happening in the where clause which is causing a table scan. With the cast the query takes 40 seconds to complete if I remove the cast the query takes 0.47 seconds.
I have researched to the point of exhaustion trying to find some way through configuration, data type tweaking or through prayer and animal sacrifice to prevent the query that is produced from Having a CAST in the where.
If anyone has any tips you will make this tired old programmer so very thankful.