Measure query amplification in trigger chains
See how many SOQL queries each transaction issues compared with the data it actually needs, find the worst trigger chains and objects, and save snapshots to track progress.
Overview
Query Amplification Intelligence measures how much extra querying your automation does. For each transaction it calculates an amplification factor:
A factor of 1 means every query fetches something new. A factor of 4 means the transaction runs four queries for every distinct piece of data it needs — usually because several triggers, handlers or Flows each fetch the same records. High amplification is a leading cause of "Too many SOQL queries: 101" errors under bulk loads.
Before you start
- The org must be synced and indexed. Use Index Org in Apex Flow Analyzer or Index in Sync Center, or the indexing buttons on this page.
- Saving a snapshot needs the
snapshots.managepermission.
Steps
- Open Query Amplification under Code & Performance Analysis.
- Pick the org.
- Click Analyze Amplification. If a recent result exists, you see "Results from cache · analyzed …" — click Refresh to recalculate.
- On Process View, review the transactions ranked by amplification. The top 10 are shown.
- Switch to Object Intelligence to see which objects are queried redundantly across processes.
- After a sync that brought in code changes, click Re-Index so the analysis reflects the new code.
- Click Save Snapshot, enter a Snapshot label (for example "Before Sprint 45 refactor") and save.
- Later, click Compare Snapshots (N) to compare saved snapshots side by side.
Example
Priya, a release manager, analyzes acme-uat and sees the Case insert chain with an amplification factor of 5.2: 26 queries for 5 distinct data needs. Object Intelligence shows Account queried from four places in that chain. She saves a snapshot labelled "Before ACME-142 selector refactor". After the developers introduce a shared Account selector and the org is re-synced, she clicks Re-Index, analyzes again and uses Compare Snapshots to show the factor dropped to 1.8.
FAQs
Is a high amplification factor always a bug?
Not always. Some duplication is harmless at low volume. It matters most for objects that are loaded in bulk (data loads, integrations, batch jobs), where each extra query is multiplied across the transaction.
Why only the top 10 transactions?
The page focuses on what to fix first. Use SOQL Risk Intelligence for the full query inventory.
Who can see snapshots?
Everyone in the workspace who can open the page can compare snapshots. Saving and deleting them needs snapshots.manage.
Troubleshooting
"This org has not been indexed yet"
Click Index This Org Now, wait for indexing to finish, then click Analyze Amplification.
"No trigger chains with SOQL found for this org"
Either the org genuinely has no trigger chains that query, or the index is out of date. Click Re-Index & Analyze to rebuild and try again.
My code change is not reflected
The analysis reads the last sync and index. Sync the org, then click Re-Index.
Related articles
Was this article helpful?
Related articles
- Save and compare org snapshotsSave Query Amplification snapshots before and after a change, then compare any two — even from different orgs — to prove SOQL and amplification improved.
- Find SOQL 101 risks with SOQL Risk IntelligenceDetect SOQL anti-patterns, duplicate queries and transaction-level query counts that risk the 100-query governor limit, and get AI remediation advice.
- Read your org's performance and governor health gradeGet a single A–F grade for an org's SOQL and data-access health, see the processes most at risk, and export a text report with recommendations.
- Index an orgBuild or rebuild an org's analysis index from its last sync so Code Intelligence, SOQL Risk, Query Amplification and other analysis pages show current results.