廢post借嚟派下膠
Don't use separator to performance storing a list to achieve one to many.
Hard to maintains the list(update, insert, delete, select)
fk column has maximum if as string
Solution build a intersection table. MySQL foreign key will automatically indexed and the fk should be reference another table index.
----------
Tree structure design
Don't use one child to one parent(self referencing) a.index a.parent reference a.index[adjacency list]
Hard to maintains(remove subtree need find the leaves first)
TBC(need deep study the example if have time)
1.Recursion query With clause(check mysql support or not)
2.Path variable a column set parent/parent/
(same problem as jaywalking)
3. CLOSURE Table (intersection table easiest)
4. Nested set(left node right node; real building C++ B-Tree)