Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

PromotionInformationGetRedemptions sql being called too many times



I am using Commerce 12.15.0.

I am trying to find the promotion price of an item using GetDiscountPrices method (I pass the content reference and the market to it). And I see from the reflector it is calling the GetRedemptionsFromDatabase method behind the scenes which in turn triggers the PromotionInformationGetRedemptions sql. And upon looking into the SQL Profiler, I see this being called many times which I was hoping will not be the case and this will be read from the cache instead. Also, this only happens when the redemption limits are set.

Example: When I set the redemption per customer to 1 (Promotion used : Buy Products for Discount on All Selections)

This has a significant performance impact, I was hoping this could be cached instead and not trigger a db call everytime. Is this expected behavior?

Edited, Sep 11, 2019 1:48

It is cached for per-promotion redemption. we decided that it would be too much to cache per-customer redemption (all customers x all promotions). however that might change...

in the latest version of commerce that SP is optimized so it will be much more lightweight. You might want to try that 

Sep 11, 2019 9:20
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.