SOQL Query Plan Tool

SOQL Query Plan Tool


Salesforce provides its own query plan tool for our developers to increase the performance of SOQL queries.  

How to enable the Query Plan Tool in my Org?

- We can have the option to enable the Query plan tool in Developer Console.

Login to the org --> Open the Developer Console --> In the Developer Console menu, Go to Help --> Preferences --> Look for the "Enable Query Plan" option --> Then double click on its value and select the Checkbox. That's it the Query Plan would get enabled.



- That's it. Now we are able to see the Query Plan option while executing the SOQL query.


How to use the Query Plan Tool?

We can write any SOQL query and before executing the query, just click on the Query Plan button. We will get the detailed query analysis in the results section.


Here in the above screenshot, after running the Query Plan, we got the detailed plan details for the mentioned query.

Each Plan will contain information on Cardinality, Operation Type, Cost, sObject Type, and more. 

Each plan has a 'Leading Operation Type', for example, Field Index or Full Table Scan. 

The plan with the lowest cost is the plan that is used for driving the query execution.


Comments

Popular posts from this blog

Apex Code Character Limit (Part I)

Deployment in Salesforce using Change sets

SFDX Developer Guide

REST API using Workbench

Customize Salesforce Login Page