Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
We are experiencing troubling behavior with getting uCommerce reports of sales and there is not much optimization we can do here since it’s based on Umbraco objects and not on C# or SQL.
IEnumerable<PurchaseOrder> results = PurchaseOrder.Find(p => (p.CompletedDate >= start_date && p.CompletedDate <= end_date && p.OrderStatus == OrderStatus.Get((int)OrderStatusCode.Paid)));
It used to work using a date range of even a week.
Now it fails on a date range of a single day!
It's been like this for a few days now. On a (rare) good day we are able to run it on a date range of a single day only, but not more than that!
We are getting 504 error and are therefore unable to create any reports.
Any help would be appreciated :)
Depending on the number of orders in the database, the query may not perform very well. It looks like you lookup order status for each order, instead of just compare the order status id, e.g.
IEnumerable<PurchaseOrder> results = PurchaseOrder.Find(p => (p.CompletedDate >= start_date && p.CompletedDate <= end_date && p.OrderStatus.OrderStatusId == (int)OrderStatusCode.Paid));
Thank you for noticing that :)
It may not be the root cause but it's already an improvement
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted