I have good experience with oracle (start with .. connect by clause ) and SQL server hierarchical queries. Indexes must be there where parent key and child...
During execution of stored procedure and trigger called within it on one of the table underlying table, following is situation of the wait type and resources.