Activity › Forums › Salesforce® Discussions › What are Governor Limits in Salesforce? Can you name 3 examples?
Tagged: Callouts, DML Statement, Governor Limits, Parent Child Relationship, Salesforce Architecture, Salesforce Platform, SOQL Query, Transaction in Salesforce
-
What are Governor Limits in Salesforce? Can you name 3 examples?
Posted by Aman on September 22, 2018 at 4:26 PMWhat are Governor Limits in Salesforce? Can you name 3 examples?
Parul replied 7 years, 7 months ago 3 Members · 2 Replies -
2 Replies
-
Salesforce runs on a multitenant environment which means resources (Storage, CPU, Memory) are shared with other companies on the Salesforce platform. This means limits must be in place to ensure that all companies using the Salesforce architecture abide by certain rules and don’t let their code or processes monopolize shared resources. A few examples of Governor Limits are:
Total number of records retrieved by a SOQL query – 50,000
Total number of SOQL queries issued – 100 (Synchronous) 200 (Asynchronous)
Total number of DML statements issued – 150
Total number of callouts (HTTP requests or Web services calls) in a transaction – 100
Maximum CPU time on the Salesforce servers – 10,000ms (Synchronous) 60,000ms (Asynchronous) - [adinserter block='9']
-
Adding some points:
In a SOQL query with parent-child relationship sub-queries, each parent-child relationship counts as an additional query. These types of queries have a limit of three times the number for top-level queries.
The row counts from these relationship queries contribute to the row counts of the overall code execution.
In addition to static SOQL statements, calls to the following methods count against the number of SOQL statements issued in a request.
Database.countQuery
Database.getQueryLocator
Database.query
From above statement i can clarify one point:For example your org contain only 2 Account and each have 10 Contacts.
If you execute this with sub Query like below
Select Id, Name, (Select Id, Name from Contacts) From Account
Then the total number of Query rows will be 22 (2+10+10).
From above analogy we can understand like this
If your org contain 40M accounts and each have 1 contact.
Then in this scenario you can use sub query up to 25M only.
Like this Select Id, Name, (Select Id, Name from Contacts) From Account limit 25M
Thanks
Log In to reply.