Db2 allows to install the EXPLAIN TABLES using a procedure (https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.admin.explain.doc/doc/t0059594.html)
There are different ways to generate an access plan, i.e., to explain a statement using SQL. One simple way is to use EXPLAIN PLAN FOR. However, it is not possible to print the generated access plan using SQL. Thus, add a table function to pretty print an access plan.
The output should be in a table format (hence table function).
For some background information see this tweet:
The new functionality closes Db2 tooling gaps. It would allow to quickly obtain AND print access plan information in Jupyter notebooks and (IBM) Data Science tools. It would also enhance the SQL consoles in our aaS offerings.
Why is it useful?
Users could directly obtain explain output using SQL without knowing details of the EXPLAIN tables. The formatted explain information could be shown in Jupyter Notebooks.
|Who would benefit from this IDEA?||Almost all Db2 users who need to look into SQL query access plans.|
How should it work?
1) see above
2) functionality is missing, it would enhance the serviceability on the command line, in all interfaces that allow to use SQL and in popular development and presentation environments like Jupyter notebooks, SQL shells, IBM Data Science, etc.
3) There are few workarounds in the form of scripts but nothing directly available.
|Priority Justification||The feature is missing and other database systems already have this very useful feature|
NOTICE TO EU RESIDENTS: per EU Data Protection Policy, if you wish to remove your personal information from the IBM ideas portal, please login to the ideas portal using your previously registered information then change your email to "firstname.lastname@example.org" and first name to "anonymous" and last name to "anonymous". This will ensure that IBM will not send any emails to you about all idea submissions