METHODS OF MODELING HIERARCHICAL STRUCTURES IN RELATIONAL DATABASES

Authors

Keywords:

Adjacency List, Nested Sets, Closure Table, Materialized Path, hierarchical structures, recursive query, relational data model

Abstract

The paper examines the main methods for representing hierarchical structures in relational databases and typical queries for these data structures. The methods reviewed include Adjacency List, Nested Sets, Closure Table, and Materialized Path. Each of these models has its own advantages and disadvantages depending on the types of operations being performed. Quantitative metrics for data retrieval times were obtained for data represented in the database using these methods. Based on these metrics, an analysis of the appropriateness of using these methods was conducted, depending on the characteristics of nesting and data volumes. Adjacency List is simple to implement and convenient for operations at the level of individual nodes, such as adding or deleting a leaf, but it is not optimal for complex queries involving retrieving subtrees or paths between nodes. Nested Sets demonstrate high efficiency in retrieving subtrees, but operations such as adding and deleting nodes are complex and resource-intensive. Closure Table offers high flexibility for queries involving ancestor and descendant relationships but requires significant resources to maintain data consistency during frequent updates. Materialized Path is efficient for queries involving retrieving paths between nodes and subtrees.

References

Krenevych A.P. Alhorytmy i struktury danykh. Pidruchnyk. – K.: VPTs "Kyivskyi Universytet", 2021. – 200 s

Joe Celko's Trees and Hierarchies in SQL for Smarties. (2004). Elsevier. https://doi.org/10.1016/b978-1-55860-920-4.x5000-4

Celko J. Trees and Hierarchies in SQL for Smarties. – Morgan-Kaufmann, 2012. – 296 p.

Markitan V. O., Vozniak M. A., Bulatetska L. V. Derevovydni struktury v SQL. Matematyka. Informatsiini tekhnolohii. Osvita. : materialy KhI mizhnar. naukovo-prakt. konf. Lutsk, 3–5 chervn. 2022 r. Lutsk, 2022. S. 109–111.

Zberihannia iierarkhichykh struktur v reliatsiinykh bazakh danykh. / V. O. Markitan, M. A. Vozniak, L. V. Bulatetska, V. V. Bulatetskyi. Kiberbezpeka: osvita, nauka, tekhnika. 2022. T. 4, №16. S. 85–97. DOI: https://doi.org/10.28925/2663-4023.2022.16.8597

Bui,D., & Poliakov,S. (2010). Rekursyvni zapyty v SQL-podibnykh movakh: pryklady, zmistova i formalna semantyka. Problemy prohramuvannia, (2-3).

Bui,D., & Poliakov,S. (2010). Kompozytsiina semantyka rekursyvnykh vyraziv ta yikhnikh uzahalnen v SQL-podibnykh movakh. Naukovi zapysky NaUKMA. Kompiuterni nauky., 112, 21–26.

Derevo katalohiv NESTED SETS (vkladeni mnozhyny) i upravlinnia nym | open2web. open2web | open2web. URL: https://open2web.com.ua/blog/derevo-katalogov-nested-sets-vlozhennye-mnozhestva-i-upravlenie-im.html

Published

2024-09-27

How to Cite

[1]
Bulatetska, L. and Bulatetskyi, V. 2024. METHODS OF MODELING HIERARCHICAL STRUCTURES IN RELATIONAL DATABASES. Applied Problems of Computer Science, Security and Mathematics. 3 (Sep. 2024), 47–65.