News for hackers. Stuff that matters.
Re:Managing Hierarchical Data in MySQL (or really any database) by dabeeeenster on Friday July 17, 2009 @09:50AM (#709839)
This is quite a neat solution, but it has a few detracting points, most notably mass updates when you want to modify the tree.

It also seems slightly irrelevant; surely it's better just to read the structure into memory when the application starts and just work on the data structure in memory?

Re:Managing Hierarchical Data in MySQL (or really any database) by derobert on Friday July 17, 2009 @10:09AM (#709886)
Reading the entire structure into memory brings all kinds of problems with it, such as knowing when to throw out your in-memory copy because the database changed. It is also problematic if the tree is large.

Reading the entire tree into memory can be effective if it never changes and is reasonably sized. But if that's the case, why are you storing it in a database? Why not just a data file?

Re:Managing Hierarchical Data in MySQL (or really any database) by rjurney on Friday July 17, 2009 @10:22AM (#709913)
In practice... in many applications you can cache parts of the tree in a session, because it won't change in a single login. If its not too big.