New stored procedures for SelectListEntities
The original stored procedure SelectListEntities is now separated into the following two distinct stored procedures:
- SelectListEntitiesByRange
- SelectListEntitiesByRangeWithoutVersioning (This procedure does not take versioning into consideration and performs better).
The Commerce Engine decides which stored procedure to call based on the entity type passed in the IFindEntitiesInListPipeline pipeline. If versioning is enabled for that entity type, or if the type is CommerceEntity, then the SelectListEntitiesByRangestored procedure is called. Otherwise, the SelectListEntitiesByRangeWithoutVersioning stored procedure is called. It is important to pass a concrete entity type if you want to take advantage of the optimized performance that the SelectListEntitiesByRangeWithoutVersioning provides.
The SelectListEntitiesByRangeWithoutVersioning query always returns entity version 1.
The SelectListEntitiesByRange behaves the same. Depending on the environment, it returns the latest published entity version or the latest entity version.
In addition, the following two new stored procedures are added:
- SelectAllListEntities
- SelectAllListEntitiesWithoutVersioning
When pagination is not used, these new stored procedures take all entities included in a list, providing better performance by avoiding expensive operations such as "order by".
New Sitecore.Commerce.Plugin.Search.SearchPolicypolicy
The Sitecore.Commerce.Plugin.Search.SearchPolicypolicy provides the following common settings to use across multiple search provides:
- MaxNumberOfRows defines the maximum number of documents that are retrieved from the index when no amount has been specified.
- IndexBatchSize splits up result into smaller batches.
This becomes very useful during the item indexing where the minion processes 1000 entities at a time by default. That number is then multiplied by the number of languages in the system and results in potentially long-running and expensive calls to Azure Search. Decreasing the batch size slices up the original result set before submitting it to the search index.
- DeleteBatchSize is currently used specifically during the incremental item indexing where items are removed from the index before re-indexing them. Gives more granular control over the number of documents that are deleted in one batch to reduce the impact on the search service.
- ConcurrentIndexingOperations controls how many batches are indexed in parallel.
The default value is 1 as that is the equivalent to the current behavior, however, it can be increased if needed. The general recommendation is not to exceed the numbers of replicas in Commerce Engine Connect configurations (for example, under C: \inetpub\wwwroot\XP0.sc\App_Config\Include\Y.Commerce.Engine)