Happy Business Starts Here

In ZQuotes simplify query to populate product list on Select Products Page

0 Kudos

In ZQuotes simplify query to populate product list on Select Products Page

When the product lookup button is clicked on the Select products page the following query is run: 

Aggregations:0|SELECT ProductRatePlanCharge__r.ProductRatePlan__r.zProduct__r.Id

FROM ProductRatePlanChargeTier__c

WHERE (Currency__c = :tmpVar1 AND ProductRatePlanCharge__r.ProductRatePlan__r.zProduct__r.Deleted__c = FALSE)

GROUP BY ProductRatePlanCharge__r.ProductRatePlan__r.zProduct__r.Id

 

Here is the warning data:

14:39:35.514 (514144996)|SOQL_EXECUTE_END|[48]|Rows:31

14:39:35.946|LIMIT_USAGE_FOR_NS|zqu| 
Number of SOQL queries: 5 out of 100 
Number of query rows: 32664 out of 50000 ******* CLOSE TO LIMIT 

In our sandbox it has exceeded the limit and failed.

 

This multiple join query uses too many rows which can exceed SF governor limit of 50,000 rows making the control unusable.

This situation is because you are only displaying products that have charge tiers in the currency used.

Couldn't you simply just show the list of products and filter on currency later if you need to. of course there are many ways you can solve this but it needs to be solved as we will be adding more products to our catalog which will break our Zuora implementation.

Also I noticed this query is executed every time the button is hit instead of using caching.  The select product page could be much more responsive to the user if some simple optimizations were made to the code.

 

2 Comments
Zuora-Community
Community Manager
Status changed to: More Feedback Needed
 
Zuora-Community
Community Manager
Status changed to: Under Consideration