Thanks Florian and Serigo,
Actually my logic goes as below:
var1 = SELECT * FROM table1;
var2 = SELECT * FROM table2;
join1 = FULL JOIN between var1 and var2
-- hereon I do not need contents of var1 and var2
var3 = SELECT * FROM table3;
join2 = FULL OUTER JOIN between join1 and var3
-- hereon I do not need contents of var3 and join1
var4 = SELECT * FROM table4;
join3 = FULL OTHER JOIN between join2 and var4
-- hereon I do not need contents of var4 and join2
-- the above logic continues for 5 more such iterations.
Question: My concern is that since I cannot delete the variables, it will occupy the space in memory throughout the life time of execution. Each SELECT fetches approx 1million rows, so memory usage will be huge as I am not releasing memory from earlier used variables. Is there solution to this?