Governor Limits in Salesforce

Since Salesforce keeps running on the multi-tenure condition and so as to have a similar presentation to the database, it has forced some runtime limits called governor limits. Governor limits are runtime limits authorized by the Apex runtime engine to guarantee that code doesn't get out of hand. Governor limits are Salesforce's method for compelling you to compose effectively, versatile code. Salesforce Governor limits counteract different organizations from reviewing terrible code and taking all the cloud CPU. Coding limits when all is said in done are totally novel to Apex – think of it as professional stability!

Governor Limits are calculated by a number of factors that determine what limit is used, and when it is applied based on the Invocation of Apex-Entry, No.of Records, Which limit to use.

There are different kinds of Governor limits like

  • Execution Governors and Limits.
  • Apex Governor Limits.
  • SOQL and SOSL Character Limits.

There are numerous sorts of Salesforce Governor limits like Pre-exchange limits, platform peak limits, static apex limits and the number of different limits.

Execution of Apex Governor Limits

These limits count each Apex transactions, these limits are reset for each execution of a batch of records in the execute method.

This table lists limits that apply for both synchronous and asynchronous apex,


Synchronous Limit

Asynchronous Limit

Total number of SOQL queries issued by the salesforce



Total number of records retrieved by SOQL queries in salesforce apex



Number of records retrieved by Database.getQueryLocator



Total number of SOSL queries issued by salesforce



Number of records retrieved by a single SOSL query in salesforce



Total DML statements issued in salesforce apex



The number of records processed as a result of DML statements like Approval.process, or Database.emptyRecycleBin



Stack profundity for any Apex conjuring that recursively flames triggers because of insert, update or delete statements



Number of callouts or HTTP requests or service calls in a transaction



Maximum methods with future annotation allow per Apex invocation


0 in batch and 1 in queueable context

Maximum cumulative timeout for all callouts per transaction

120 seconds


SendEmail methods allowed in salesforce



Maximum Apex jobs added to the queue with System.enqueueJob in salesforce



Total Heap size in salesforce



Maximum CPU Time consumed on the Salesforce server





Maximum execution time for each Apex transaction

10 minutes


Maximum push notification method calls allowed per Apex transaction



Maximum push notifications that can be sent to each push notification method calls



SOQL and SOSL Limits

Salesforce Object Query Language is used to read information stored in your org database. SOQL query in Apex code or in the Developer Consoles Query Editor. Salesforce Object Search Language is a salesforce search language which is used to perform text searches in records, Mainly SOSL is used to search fields across multiple standard and custom object records in salesforce.



Limit Description

SOQL statements

The maximum length of SOQL statements

20.000 characters


The maximum length of SOQL WHERE clause

4,000 characters

SOSL statements

The maximum length of SOSL statements

20,000 characters, This limit is tied to the SOQL statement character limit defined for your org.

SOQL search query strings

The maximum length of the SearchQuery string

If SearchQuery>10,000 characters then result rows are not returned. If SearchQuery>4,000 characters then logical operations are removed.

SOSL query results

Maximum rows returned

2,000 results, by custom limits otherwise it returns 200 results

Relationship Queries

Relationship query limits

More than 35 child-parent relationships are not specified in the query, custom object which allows 25 relationships which are referred.




Maximum RecentlyViewed records allowed

Recently viewed data on a periodic basis is 200 records. It is updated when records are retrieved using the FOR VIEW or FOR REFERENCE clause in a SOQL

OFFSET clause

Maximum number of rows skipped by OFFSET

The maximum offset is 2,000 rows. If we want more  OFFSET it results in a NUMBER_OUTSIDE_VALID_RANGE error

Posted On 22 November 2019 By MicroPyramid

About Micropyramid

Micropyramid is a software development and cloud consulting partner for enterprise businesses across the world. We work on python, Django, Salesforce, Angular, Reactjs, React Native, MySQL, PostgreSQL, Docker, Linux, Ansible, git, amazon web services. We are Amazon and salesforce consulting partner with 5 years of cloud architect experience. We develop e-commerce, retail, banking, machine learning, CMS, CRM web and mobile applications.

Need any Help in your Project?Let's Talk


Subscribe To our news letter

Subscribe and Stay Updated about our Webinars, news and articles on Django, Python, Machine Learning, Amazon Web Services, DevOps, Salesforce, ReactJS, AngularJS, React Native.
*We don't provide your email contact details to any third parties