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.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c1dc-2c2e4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c1dc-2c2e4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?