locked
Why delay of 30 to 40sec on first load from ProductSet? RRS feed

  • Question

  • Crm Product entity contains 40,000 records.

    In CustomerPortal, i am simply fetching all products and bind them to Grid.

    For Fetching querry 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 didnt use session/cache and anything like that.

    If i use the below querry (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?

    Wednesday, July 2, 2014 5:36 PM