My Entity Framework is set up to emit the SQL generated, followed by the time taken to run the query, to the Output pane.
When I run it locally, the EF query takes .064s (as can be seen in the Output pane), and the SQL (when run by itself in Management Studio) takes about the same. In production the EF query takes .660s, yet the SQL generated only takes .157s.
There are about 50 rows returned. All the other EF queries are running at the expected speed.
What can cause the EF to take so much longer to run than the SQL it generates?
Thank you for any ideas.