Apex governor limits
Apex stops a transaction that runs too many queries, too many saves, too many rows, or too much CPU. The table lists those four synchronous limits.
| Limit | Cap | What it means |
|---|---|---|
| SOQL queries | 100 | A synchronous transaction can run 100 SOQL queries, so a query inside a loop spends one of them per pass. |
| DML statements | 150 | A synchronous transaction can run 150 DML statements, and one update of a whole list still counts as one statement. |
| Query rows | 50,000 | SOQL in one transaction can return 50,000 rows in total, across every query, not per query. |
| CPU time | 10 seconds | Synchronous Apex gets 10 seconds of CPU time, which loops over large lists can spend before the work finishes. |