Loading

Maximum number of rows returned by SOQL queries over the REST API

Publiseringsdato: Oct 13, 2022
Beskrivelse
Here are some considerations while using the REST API resource to perform SOQL queries. 
Løsning
  • The maximum result size is 2000, but this can be smaller if you have selected several fields or if you have included blob fields (e.g. long text area fields, rich text area fields) in your SOQL query.
  • In each REST call, the maximum length for the combined URI and headers is 16,384 bytes. A request exceeding this limit returns a 431 Request Header Fields Too Large error. If the URI itself exceeds this limit, the request returns a 414 URI Too Long error. 
  • The maximum query length is likely to be smaller than allowed URI limit because SOQL queries get translated and augmented with more information needed by the server side to execute the query (e.g. user name, org, complex formulas showing relationships etc.). It’s recommended to limit URI length to 2000 characters and headers to approximately 8000 bytes.
  • Responses can be sent transfer-encoding: chunked, which has no fixed or estimated response size (content-length). The underlying reason for limiting the number of records is database performance, not application server performance.
To avoid "431 Request Header Fields Too Large" error, try to incorporate the SOQL statement into the body of a Composite API request as one of the 25 allowed subrequests.  The Composite response body will be slightly different from direct /query or /queryAll requests.

The need to paginate and retrieve additional results via the nextRecordsUrl value in the response (see Retrieving the Remaining SOQL Query Results ) can similarly be achieved by submitted via the Composite API or directly hitting the /query endpoint surfaced in the nextRecordsUrl field.

Query REST API
Working with Searches and Queries
Request Size Limits
Knowledge-artikkelnummer

000386264

 
Laster
Salesforce Help | Article