Database design – closure table design of tree structure type

Original link: https://ldqk.xyz/2165

The closure table is a simple and elegant solution to hierarchical storage. It records all the node relationships in the table, not just the direct parent-child relationship. In the design of the closure table, an additional node relationship table (space for time) is created, which contains two columns, each of which is a foreign key pointing to the primary key in the tree structure. This table stores all the node data related to it, including itself.

This article is reprinted from: https://ldqk.xyz/2165
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment