title: How to reduce the loading time
body: <p>I am updating a product within category, but my query loading time is 4.32s. But cosmos db is read pass. Is there any way to reduce time? Please suggest me any idea.</p>
  
  <p>For the first load it takes around 5s, then it takes 3-4.5 seconds. Is there any way to solve this issue?</p>
  
  <p>My <strong>repository class</strong> code :</p>
  
  <pre class="lang-cs prettyprint-override"><code>public async Task&lt;Catalog&gt; UpdateProductInMainCategory(Guid productid, Product productData)
  {
      var feedOptions = new FeedOptions
       {
           MaxItemCount = -1,
           EnableCrossPartitionQuery = true
       };
  
      var query =
          $"SELECT catalog.id,catalog.VendorName,catalog.Industy,product1 FROM catalog join industry in catalog.Industy join category in industry.Category join product1 in category.Product join Subcategory in category.Subcategory join product in Subcategory.Product where product1.Id ='" + productid + "'";
  
      var catlog = _cosmosClient.CreateDocumentQuery&lt;Catalog&gt;(UriFactory.CreateDocumentCollectionUri(
      _azureCosmosDbOptions.Value.DatabaseId, "catalog"), query, feedOptions).AsEnumerable().FirstOrDefault();
  
      Console.WriteLine("i am kajas");
  
      if (catlog != null)
      {
          foreach (var item in catlog.Industy)
          {
              foreach (var cat in item.Category)
              {
                  Product product = cat.Product.FirstOrDefault(p =&gt; p.Id == productid);
                  if (product != null)
                  {
                      product.Name = productData.Name == null ? product.Name : productData.Name;
                      product.Addons = productData.Addons == null ? product.Addons : productData.Addons;
                      product.CurrentQuantity = 
                      break;
                  }
  
              }
              break;
          }
      }
      var requestOptions = new RequestOptions
        {
            PartitionKey = new Microsoft.Azure.Documents.PartitionKey(catlog.Id.ToString())
        };
  
      var orderDocument = await _cosmosClient.ReplaceDocumentAsync(
           UriFactory.CreateDocumentUri(
               _azureCosmosDbOptions.Value.DatabaseId, "catalog", catlog.Id.ToString()), catlog, requestOptions);
  
      return (Catalog)((dynamic)catlog);
  }
  </code></pre>