Tuesday, May 12, 2020

SOQL vs SOSL Salesforce

a. What is SOQL?
SOQL stands for Salesforce Object Query Language. It utilizes the Salesforce Object Query Language (SOQL) to develop basic yet intense  inquiry strings in the queryString parameter in the question() call, in Apex explanations, in Visualforce controllers and getter techniques,  or in the Schema Explorer of the Force.com IDE.
Like the SELECT summon in Structured Query Language (SQL), SOQL enables you to indicate the source protest, (for example, Account), a rundown of fields to recover, and conditions for choosing columns in the source question. 
SOQL utilizes the SELECT explanation joined with sifting articulations to return sets of information, which may alternatively be requested.
b. What is SOSL?
SOSL stands for Salesforce Object Search Language. It Utilizes the Salesforce Object Search Language (SOSL)  to build content inquiries in the inquiry() call, in Apex proclamations, in Visualforce controllers and getter techniques.
Not at all like SOQL, which can just inquiry one question at any given moment, SOSL empowers you to seek content, email, and telephone fields for various protests at the same time.

SOQL vs SOSL – Limitations

Basically, on the ground rule, SOSL and SOQL bath have the same amount of limitations. As per the government rules its stated below:
DescriptionLimit
Total number of SOQL queries issued100
Total number of SOQL queries issued for Batch Apex and future methods200
Total number of records retrieved by SOQL queries50,000
Total number of records retrieved by Database.getQueryLocator10,000
Total number of SOSL queries issued20
Total number of records retrieved by a single SOSL query200
SOQL vs SOSL – SyntaxSOQL syntax and SOSL syntax both differ a lot when it comes to syntax. Best could be understood by an example:
SOQL
SELECT Id, Name FROM Account WHERE Name = 'Acme'Return all Accounts where the Name is exactly Acme.SOSL
FIND {Joe Smith} IN Name Fields RETURNING lead(name, phone)

The difference could be seen in the name of Joe Smith in the name field of lead and return the name as well as the phone number.

No comments: