I have a lot of products with the same properties. I mean all products need the same information to be stored in database. The only difference is that some products are spare parts for other ones.

I'm thinking about making a single table with an ID for ever product. Also a ParentID field to store it's parent id. I'm thinking if this way is better? or having two tabled and join them?

Which solution has a better performance?

没有正确的解决方案

其他提示

Try using nested set, here is a good explanation :)

http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top