How to store big binary tree

How to store big binary trees (about thousands in depth).We tried to store in database, in table with rows: elem, parent, left_child, right_childbut it's very slow to handle this tree (to calculate, draw a part of it).Which way you recommend? (calculating may be done in php). May be to store it in XML or json (text file) or in some matrices?
 
Back
Top