It seems Oracle's execution plan indent each row for just one character. See below image. Is there a setting to increase this value? To me, this is not very readable.
1 Answer
You can use PLAN_TABLE for such result as following:
Your statement for generating the execution plan
EXPLAIN PLAN
SET STATEMENT_ID = 'mystatement1' -- give your statement a meaningful ID so that we can fetch it from PLAN_TABLE using it
FOR
SELECT
*
FROM
ACTIVE_USERS;
Now, Fetching the execution plan from PLAN_TABLE
SELECT
ID,
-- LPAD(' ', LEVEL - 1) -- default format
LPAD(' ', LEVEL * 2) -- Indentation is done using this
|| OPERATION
|| ' '
|| OPTIONS
|| ' '
|| OBJECT_NAME "Operation",
OBJECT_NAME AS "Name"
FROM
PLAN_TABLE
CONNECT BY PRIOR ID = PARENT_ID
AND PRIOR STATEMENT_ID = STATEMENT_ID START WITH ID = 0
AND STATEMENT_ID = 'mystatement2'
ORDER BY
ID;
Output:
You can add more columns into result according to your need and also add more spaces using LPAD in the above query.
Cheers!!
dbms_xplan
package to display the plan, you can write your own (recursive) statement that retrieves the plan fromplan_table
and uses a different number of spaces to indent. Pretty much the way it was done before Oracle introduceddbms_xplan.display()