Optimising MySQL queries when using Entity Framework
Posted: Wed 14 Oct 2009 12:43
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?
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?