Today I selected an execution plan from an SQL statement recently executed. I used:
select
id, parent_id,
lpad (' ', 3*depth) || operation || ' ' || options ||
decode (object\_name, null, null, ' on ' || object\_owner || '.' || object\_name) **op**
from v$sql_plan
where sql_id = :sql_id and child_number = :child_number
order by id;
and analyzed it automatically. My newly-written procedure threw assertions telling me the structure is corrupt: the links by parent_id do not match the depth.
The depth seems to be correct, the parent_id seems sometimes zeroed.
Am I missing something?
