Crm Product entity contains 40,000 records.
In CustomerPortal, I am simply fetching all products and bind them to Grid.
For fetching query and binding code is like:
var DataSource = from products in xrm.ProductSet
select new DTO_RequiredProductField()
{
Id = products.Id.ToString(),
Name = products.Name.ToString(),
Price = products.Price.ToString()
};
gdvProduct.DataSource = DataSource;
gdvProduct.DataBind();
This working fine, but only on first load it take upto 30 to 40 sec to load (after that the same page loads in just 2sec).
I didn't use session/cache and anything like that.
If i use the below query (taking only 5 records) then also the same delay behaviour:
var DataSource = from products in xrm.ProductSet.Take(5)
select new DTO_RequiredProductField()
{
Id = products.Id.ToString(),
Name = products.Name.ToString(),
Price = products.Price.ToString()
};
Why delay of 30 to 40sec on first load?