Ownership and lookup skew
14 min · Evaluate · Advanced · Release check pending
- I can spot ownership skew and lookup skew in a data model before go-live.
- I can choose a fix that keeps sharing changes and data loads fast.
Why this matters
Picture a go-live where everything worked in testing. Then the admin moves one user to a new role, and the change runs for hours. The next night, a data load fails with lock errors. Both problems have the same root: too many records piled on one owner or one parent.
How it works
Data skew means a very uneven spread of records. I watch for two kinds when I design a model.
Ownership skew
Ownership skew means one user owns a huge number of records of one object. Salesforce's guidance is to watch for more than records per owner.
It often comes from an integration user, or a "default owner" that catches unassigned records. The records are fine. The trouble starts when that owner changes. If I move the owner to a new role, or change their group membership, Salesforce must recalculate sharing for every record they own. With a huge pile, that is slow, and other sharing changes queue up behind it.
Lookup skew
Lookup skew means a huge number of child records point at one parent record through a lookup. A common case is a "General" account, or one shared reference record that every new record points to. The same guidance number applies: children on one parent is my warning sign.
When I insert or update a child, the platform briefly locks the parent. One lock is cheap. Thousands of parallel inserts that all want the same parent fight over the same lock. Some of them fail with UNABLE_TO_LOCK_ROW.
How I design it out
- I spread ownership across several owners, for example one integration user per region or business unit.
- If one owner is unavoidable, I keep that user out of the role hierarchy, or in a role of its own at the top. Then I never move it.
Picture it
Ownership skew
sharingOne owner, many records. Hurts when the owner's role or groups change. Fix: spread owners, keep a single owner out of the hierarchy or at the top.
Lookup skew
lockingOne parent, many children through a lookup. Hurts during parallel inserts and updates. Fix: spread children across parents, use a picklist for small fixed lists.
Example
A company loads 3 million support cases from an old system. The plan sets every case's owner to one integration user. Every case also looks up to one "Legacy Import" account.
I see two skews in one design. First, I split ownership. Cases get a regional integration user, so each owner stays under the guideline. Second, I drop the "Legacy Import" account. Each case points to its real customer account. Where no customer is known, I spread those cases across a few placeholder accounts.
Then I check one more thing. The integration users sit in a role at the top of the hierarchy, and nobody plans to move them.
Under the hood
Sharing is stored in rows. When access changes, the platform rewrites share rows and group membership rows. For one owner with a huge pile of records, a role change means rewriting rows for all of them. That is why the size of the pile matters more than the size of the object.
Locks work at the record level. A child insert locks its lookup parent so the parent stays consistent, for example for roll-ups. Many writers on one parent means they wait in line. When the wait runs too long, the write fails.
Gotchas
- Skew is about distribution, not object size. A 50-million-row object can be fine if ownership is spread.
- The guideline number is a warning sign, not a hard limit. Nothing stops me at that number. Things just get slow.
- Queues and placeholder users can create ownership skew too. A "catch-all" queue needs the same thinking.
- Master-detail children also lock their parent. Lookup skew is not only a lookup problem.
- A load that works in a sandbox can still fail in production. Parallel batches create lock contention that a small test never shows.
Try it
Exercise A
ScenarioComplete thisAn org has 400,000 Leads, all owned by one 'Web Lead' user in a mid-level role. Marketing wants to move that user under a new manager. Complete the analysis.
- Is this ownership skew? Compare the count with the guideline.
- What happens when the user moves?
_____ - Two fixes I could apply:
_____and_____
Exercise B
DesignYou are designing a custom Shipment object. Every Shipment looks up to a Warehouse record, and there are only three warehouses. Nightly loads insert 200,000 shipments in parallel. Design the model so the loads do not hit lock errors. Say what you would change and what you would give up.
Revision summary
- Data skew = an uneven spread of records on one owner or one parent.
- Ownership skew hurts when the owner's role or groups change: sharing must be recalculated for every record.
- Lookup skew hurts during parallel writes: children lock the parent.
- Guideline: watch for more than records per owner or children per parent.
- Fixes: spread owners, keep a single owner out of the hierarchy or at the top, avoid catch-all parents, consider picklists, shape loads.
Revision questions
Interview questions
What changed
- Winter '27Minor changeFirst published.
Sources
- Designing Record Access for Enterprise Scale Not yet checked
- Best Practices for Deployments with Large Data Volumes Not yet checked
Finished this page?
About this lesson
- Study time
- 14 min
- Thinking level
- Evaluate
- Level
- Advanced
- Release
- Release check pending · 2 facts to verifyChecked on 4 Dec 2026, API 68.0
Exam objectives
- da-dm-04Avoid data skew