nuno-faria opened a new issue, #19215:
URL: https://github.com/apache/datafusion/issues/19215

   ### Is your feature request related to a problem or challenge?
   
   It would be useful to collect plans from queries automatically, without 
needing to explicitly add `EXPLAIN ANALYZE`. This would ensure that the 
original application would not need to change, as the queries would still 
return data as normal, while the plans would be printed to `stdout`/`stderr`.
   
   Some existing systems already support this feature, like 
[`auto_explain`](https://www.postgresql.org/docs/18/auto-explain.html) in 
Postgres and [`eqp`](https://www.sqlite.org/eqp.html) in SQLite.
   
   ### Describe the solution you'd like
   
   Some `datafusion.execution.auto_explain` config that would enable this 
feature.
   
   I already created a small proof of concept and this feature would be 
relatively easy to implement. We just need to wrap execution plans in an 
`AnalyzeExec`. This `AnalyzeExec` would also need a flag to know when it's in 
the `auto_explain` mode, in which case it would print the plans and return the 
input batches.
   
   I would be happy to create a PR with this.
   
   ### Describe alternatives you've considered
   
   Adding `EXPLAIN ANALYZE` manually, but this changes the application.
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to