I'm evaluating transferring our code to use Entity Framework via the Devart provider, connecting to a MySQL database. In the past we've found that naive MySQL queries don't always optimise well, for example when doing a join among several tables MySQL picks a poor join order.
Using raw SQL it's easy enough to add hints to the MySQL optimiser to override the default table ordering or index choice, and getting this right can often improve query performance significantly. Is this level of control available to us if we use entity framework? Presumably one solution is to add views that are backed by custom queries with the right optimisation hints, is this the only way to achieve it?
Optimising MySQL queries when using Entity Framework
You have two alternatives - the first one is to create views in your database implementing the
desired behaviour, and the second one is to manually create Defining Query in the Storage model
and entities in your conceptual model corresponding to these Defining Queries.
We cannot advise you any other appropriate way to deal with the described situation.
desired behaviour, and the second one is to manually create Defining Query in the Storage model
and entities in your conceptual model corresponding to these Defining Queries.
We cannot advise you any other appropriate way to deal with the described situation.