Activity Forums Salesforce® Discussions What is the maximum number of rows that SOQL and SOSL can “scan”?

  • PRANAV

    Member
    April 9, 2018 at 11:02 am

    Hi,

    LIMIT is an optional clause that can be added to a SOSL query to specify the maximum number of rows that are returned in the text query, up to 2,000 results. If unspecified, the default is the maximum 2,000 results. The default 2,000 results is the largest number of rows that can be returned for API version 28.0 and later. 

    The LIMIT clause has no limit in and of itself. It's limited to the context in which it's used. If it's used in Apex code it's limited to the total governor limit for SOQL rows, which is currently 50,000. If it's used in a query via the Web Service API then there is no limit.

    Hope this helps you.

  • Ratnakar

    Member
    April 10, 2018 at 2:12 pm

    Maximum Number of SOQL queries in a transaction: 100

    Maximum Number of query rows in a transaction: 50000

    Maximum Number of SOSL queries in a transaction: 20

  • shariq

    Member
    September 20, 2018 at 8:13 pm

    Hi,

    Found this online-

    LIMIT is an optional clause that can be added to a SOSL query to specify the maximum number of rows that are returned in the text query, up to 2,000 results. If unspecified, the default is the maximum 2,000 results. The default 2,000 results is the largest number of rows that can be returned for API version 28.0 and later. 

    The LIMIT clause has no limit in and of itself. It’s limited to the context in which it’s used. If it’s used in Apex code it’s limited to the total governor limit for SOQL rows, which is currently 50,000. If it’s used in a query via the Web Service API then there is no limit.

    Hope this helps.

  • Parul

    Member
    September 22, 2018 at 1:06 pm

    The Governor Limits enforces the following:-

    Maximum number of records that can be retrieved by SOQL command: 50,000.

    Maximum number of records that can be retrieved by SOSL command: 2,000

Log In to reply.

Popular Salesforce Blogs