Osiągaj hierarchię, relacje rodzic / dziecko w skuteczny i łatwy sposób

Mam taki stół

create table site
(
site_Id int(5),
parent_Id int(5),
site_desc varchar2(100)
);

Znaczenie pól:

site_Id: Id witrynparent_Id: Nadrzędny identyfikator witrynysite_desc: choć nie odnosi się do pytania, ale ma opis witryny

Wymóg jest taki, że jeśli mam dane wejściowe site_id i potrzebuję wszystkich identyfikatorów oznaczonych poniżej witryny. Na przykład:

                    A
                   / \
                  B   C
                / | \ /\
               D  E F G H
              /\
             I  J

Wszystkie węzły to id_strony.

Tabela zawiera następujące dane:

Site_id  | Parent_ID  |  site_desc
_________|____________|___________
 A       |   -1       |   
 B       |    A       |
 C       |    A       |
 D       |    B       |
 E       |    B       |
 F       |    B       |
 I       |    D       |
 J       |    D       |

......

A jest rodzicem B i C i tak dalej.

Jeśli B to dane wejściowe, zapytanie musi pobrać D, E, I, F, J

Osiąga się to obecnie za pomocą wielu zapytań w pętli, ale myślałem o osiągnięciu tego w minimalnej liczbie zapytań.

Obecnie robię to:

głosowanie w dół

Algorytm wygląda tak:

Initially create a data set object which you will populate, by fetching data from the data base. 
Create a method which takes the parent id as parameter and returns its child nodes if present, and returns -1, if it doesnt have a child. 
Step1: Fetch all the rows, which doesn't have a parent(root) node. 
Step2: Iterate through this result. For example if prod1 and prod2 are the initial returned nodes, in the resultset. 
Iterating this RS we get prod1, and we insert a row in our DataSET obj. 
Then we send the id of prod1 to getCHILD method, to get its child, and then again we iterate the returned resultset, and again call the getCHILD method, till we dont get the lowest node.

Potrzebuję najlepszej zoptymalizowanej techniki w ramach mojego ograniczenia modelu danych. Odpowiadaj, jeśli masz jakieś sugestie.
Proszę zasugerować cokolwiek. Z góry dziękuję.

questionAnswers(10)

yourAnswerToTheQuestion