Documentation Home

Price List Caching

For better performance applying price lists, we recommend properly setting up caching. This document provides a simple guideline on how to setup basic price list caching.

Price List Threshold for Full Cache

If a price list has less than a certain amount of sku price data entries associated with it, then the entire sku price data map for that price list is cached in the blPriceDataCache cache region. The property pricelist.thresholdForFullCache is used specify the threshold amount. By default, the threshold is 1000.

We recommend setting the pricelist.thresholdForFullCache property to an amount that properly accommodates the majority of your price lists. Here is a useful SQL query that will return all price lists and the number of sku price data entries associated with them:

SELECT BLC_PRICE_LIST.PRICE_LIST_ID, BLC_PRICE_LIST.FRIENDLY_NAME, COUNT(BLC_SKU_PRICE_DATA.SKU_PRICE_DATA_ID) as NUMBER_OF_SKU_PRICE_DATA_ENTRIES
FROM BLC_PRICE_LIST
LEFT OUTER JOIN BLC_SKU_PRICE_DATA ON BLC_PRICE_LIST.PRICE_LIST_ID = BLC_SKU_PRICE_DATA.PRICE_LIST_ID
GROUP BY BLC_PRICE_LIST.PRICE_LIST_ID;

If your price lists contain a very large amount sku price data entries and you are concerned about the memory impact of caching multiple price lists and their entire set of sku price data, then we recommend tweaking the query.PriceList cache.

Price List Query Cache

When sku price data is not found in the blPriceDataCache and the price list that is being evaluated has data entries that exceed the threshold, then the sku price data for a specific price list is queried manually from the database. This query is cached in the query.PriceList cache region. However, this query will be performed multiple times for each sku since SkuPriceDataServiceImpl attempts to retrieve the sku price data for every price list for each sku, even if there is not an entry. Therefore in order to properly accommodate all of these cache entries we recommend setting the maxElementsInMemory property for the query.PriceList cache region to an amount equal to the number of sku times the number of price lists. You can do this by overriding the cache region. This ensures that there are enough entries to account for all of the queries. While the number of cache elements may be large, the amount of actual data that gets cached should be lower since some of the queries return nothing and the only data that is being cached is the sku price data for a specific sku.