I proposed something like this when I worked at a certain "Facebook killer" about 10 years ago, but I didn't know if it was possible to store and efficiently query hierarchical data from an RDBMS at the time, and nobody took me seriously anyway. It's one of several features I thought about for years for a site like this, so when I decided to resurrect Gyrate, it's one of the first things I built.
Someday when I have more time, I plan to write about all these things I built and how they work.