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
Ken Koellner @ EngagewareKen Koellner @ Engageware 

I noticed Apex Debug Logs do not explain query plans for Dynamic SOQL, only static SOQL

This isn't so much a question as an observation, unless someone knows a work around.

It's nice the Apex debug logs now show an explanation of the query plan for SOQL as shown below --

10:00:09.343 (6541134992)|SOQL_EXECUTE_EXPLAIN|[150]|Index on Event : [Meeting__c], cardinality: 1, sobjectCardinality: 12760, relativeCost 0.001

However, it only does that for static SOQL.  For dynamic SOQL, it doesn't show a query plan--

10:00:09.343 (6677301225)|SOQL_EXECUTE_EXPLAIN|[312]|No explain plan is available

There are some cases where I wanted to check that a generated query was efficient so I had to extract the SOQL generated, then run it manually in Dev Console to check it.

It would be nice if debug also showed query plans for Dynamic SOQL.
SwethaSwetha (Salesforce Developers) 
Hi Ken,
As you are already aware, the query plan is something not available for dynamic SOQL. 

Found a similar ask from the past:

Recommend logging an Idea on IdeaExchangePortal as a feature request.

If this information helps, please mark the answer as best. Thank you
Ken Koellner @ EngagewareKen Koellner @ Engageware
I've found anything having to do with Development gets virtually zero love on the IdeaExchange.  The ratio of developers to admins and end users is so low that almost anything that's pure development-oriented never gets enough votes to even be seen.

I really think there should be a seperate Idea Exchange just for  development and technical features unrelated to business funcitonality.