How does the infinite layer distribution system quickly find all team members, as well as all superior members, except recursion

1. Now there is an unlimited distribution system, An invited BBJ c, then b and c invited N individuals respectively, and so on, is there any good way to quickly find all the superiors of N and all the team members of N

Apr.11,2021

except recursion? It won't happen.
unless your database sets a distribution record for everyone, there is too much redundant data like this


well, mine is infinite,


search mysql tree table design keywords
https://blog.csdn.net/qq16041.

Adjacency List: every record parent_id
Path Enumerations: every record the whole tree path goes through the node enumeration
Nested Sets: each record store nleft and nright
Closure Table: maintains a table, and all tree path are saved as records.
Menu