function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Leticia Monteiro Freitas 4Leticia Monteiro Freitas 4 

How I can the execution time from my query

Hello, 

Is there anyway to know how much time takes to my query execute?
Raj VakatiRaj Vakati
Yes .. You can use Query plan tool from the developer console and you can use custome debug logs 

The Query Plan tool is a new addition to the Developer Console since Summer '14.  From the documentation:

"The new Query Plan tool in the Developer Console can help speed up SOQL queries done over large volumes.
Use the Query Plan tool to optimize and speed up queries done over large volumes. To enable the tool, click Help > Preferences and set Enable Query Plan to true. To use the tool, enter your query and click the Query Plan button in the Query Editor. The Query Plan window displays all query operations and the cost of each."


https://help.salesforce.com/articleView?id=000199003&type=1


https://trailhead.salesforce.com/en/content/learn/modules/database_basics_dotnet/writing_efficient_queries

https://help.salesforce.com/articleView?id=code_dev_console_tab_query_editor_query_plans.htm&type=5

http://www.salesforcegeneral.com/salesforce-articles/soql-query-plan-tool.html