Data Skew in Salesforce
Data Skew in Salesforce
#kb_sfdc_content
1. Introduction to Data Skew in Salesforce
2. Types of Data Skew
- 2.1 Ownership Skew
- 2.2 Lookup Skew
- 2.3 Account Data Skew
3. Best Practices to Mitigate Data Skew
- Distribute Data Evenly
- Use Asynchronous Processes
- Optimize Sharing Settings
- Monitor Performance
- Index Critical Fields
#kb_sfdc_content
1. What Is Data Skew
Data skew refers to performance and data integrity issues that occur when a large number of records are
associated with a single record in Salesforce.
This can create an imbalance that impacts system performance, particularly during updates or when sharing
calculations are being performed.
#kb_sfdc_content
2.1) Ownership Skew
Ownership skew happens when a single user owns more than 10,000 records of a single object.
This can lead to performance issues because Salesforce must recalculate sharing rules every time a record is updated.
If the user is part of a role hierarchy, any changes to their role can cause extensive sharing recalculations.
Example:
#kb_sfdc_content
Solution:
#kb_sfdc_content
2.2) Lookup Skew
Lookup skew occurs when a large number of records look up to a single record within a lookup relationship. This can
create performance issues during updates or deletions because the parent record is locked to maintain data integrity.
Example:
#kb_sfdc_content
Solution:
#kb_sfdc_content
2.3) Account Data Skew
Account Data Skew is a specific type of ownership skew related to the Account object. It occurs when a large
number of child records (like Contacts, Opportunities, or Cases) are associated with a single Account.
Example:
- An "Account" called "GlobalCorp" has 20,000 Contacts, 5,000 Opportunities, and 10,000 Cases associated with it.
- Any updates to "GlobalCorp" can cause significant performance issues due to the large number of related records.
- Changes to the "Account" record trigger sharing recalculations and potential locks on related records.
#kb_sfdc_content
Solution:
#kb_sfdc_content
3. Best Practices to Mitigate Data Skew
#kb_sfdc_content
3. Optimize Sharing Settings:
- Use public read/write groups or roles where possible to minimize sharing recalculations.
- Regularly review and optimize sharing rules to ensure they are not overly complex.
4. Monitor Performance:
- Use Salesforce performance monitoring tools to identify and address data skew issues.
- Regularly audit data to ensure it is evenly distributed and does not cause skew.
#kb_sfdc_content
#kb_sfdc_content