Hi,
Using the NorthwindIB database, I inserted 50k records in Order Table.
When I used the native SQL Adapter, it only took me a second to fetch the data.
SqlDataAdapter
adap = new
SqlDataAdapter("SELECT TOP 50000 * FROM dbo.[Order]", @"Data Source=IVON\SQL2008R2;Initial Catalog=NorthwindIB;Integrated Security=SSPI;");
DataSet
dt = new
DataSet();
adap.Fill(dt);
But when I execute this query using Devforce:
NorthwindIBEntities _context = new NorthwindIBEntities();
var orderquery = _context.Orders.Select(p => p).OrderBy(p => p.OrderID).Skip(0).Take(50000);
_context.ExecuteQueryAsync(orderquery, p =>
{
if (!p.HasError)
{
// My code here..
}
}, null);
It took me 30 seconds to finish the async query..
Why is this so? Am I missing some configuration or performance tips?
Another, when I use the SQL Profiler to get the SQL query provided by Entity Framework and execute it in the Management Studio, it also took me a second to finish it.
Your help is highly appreciated. :)
Thanks,
Von