Recursive join
The recursive join is an operation used in relational databases, also sometimes called a "fixed-point join". It is a compound operation that involves repeating the join operation, typically accumulating more records each time, until a repetition makes no change to the results (as compared to the results of the previous iteration).[1] For example, if a database of family relationships is to be searched, and the record for each person has "mother" and "father" fields, a recursive join would be one way to retrieve all of a person's known ancestors: first the person's direct parents' records would be retrieved, then the parents' information would be used to retrieve the grandparents' records, and so on until no new records are being found.
In this example, as in many real cases, the repetition involves only a single database table, and so is more specifically a "recursive self-join".
Recursive joins can be very time-consuming[2] unless optimized through indexing, the addition of extra key fields, or other techniques. Graph traversals come at a lower cost than the method of recursive joins.[3]
Recursive joins are highly characteristic of hierarchical data, and therefore become a serious issue with XML data. In XML, operations such as determining whether one element contains another are extremely common, and the recursive join is perhaps the most obvious way to implement them when the XML data is stored in a relational database.
The standard way to define recursive joins in the 1999 standard is by way of recursive common table expressions. Database management systems that support recursive CTEs include Microsoft SQL Server, Oracle, PostgreSQL and others.
See also
References
- ↑ Zygiaris, Sotirios (2018-08-23) (in en). Database Management Systems: A Business-Oriented Approach Using ORACLE, MySQL and MS Access. Emerald Group Publishing. pp. 136. ISBN 978-1-78756-696-5. https://books.google.com/books?id=a4poDwAAQBAJ&q=%22recursive+join%22&pg=PA136.
- ↑ Healey, Christopher G. (2016-11-17) (in en). Disk-Based Algorithms for Big Data. CRC Press. pp. 127. ISBN 978-1-315-30286-7. https://books.google.com/books?id=X4OKDQAAQBAJ&q=%22recursive+join%22&pg=PA127.
- ↑ Resources, Management Association, Information (2016-04-20) (in en). Big Data: Concepts, Methodologies, Tools, and Applications: Concepts, Methodologies, Tools, and Applications. IGI Global. pp. 596. ISBN 978-1-4666-9841-3. https://books.google.com/books?id=BKEoDAAAQBAJ&q=%22recursive+join%22&pg=PA596.
Original source: https://en.wikipedia.org/wiki/Recursive join.
Read more |