Performance issues with contract unit cost calculation BRDescriptionBR - Update Contract Cost per Asset on Asset Covered [clm_m2m_contract_asset] table: Trigger: Association or removal of an asset from a contract.Function: Calculates and updates the contract with the unit cost.Performance Issue: Runs extensively when a contract has a large number of assets, causing delays. Root cause: Current Process: Fetches all asset records of a contract into memory using GlideRecord and loops through the result set to count assets. Problem: This process is causing performance issues. Solution: Replace GlideRecord with GlideAggregate.Steps to Reproduce Create a Contract: Generate a contract with a large number of assets (400,000 or more).Add Asset: Add an additional asset to the contract.Observe: Note that the Business Rule (BR) is causing performance issues.WorkaroundThe update set with the code fix is attached to the PRB.Related Problem: PRB1803637