Download presentation
Presentation is loading. Please wait.
Published byJocelin Thompson Modified over 8 years ago
1
Jennifer Widom Recursion in SQL Nonlinear and Mutual Recursion
2
Jennifer Widom SQL With Recursive Statement With Recursive R1 As (query-1), R2 As (query-2),... Rn As (query-n) Nonlinear & Mutual Recursion
3
Jennifer Widom SQL With Recursive Statement With Recursive R As ( base query Union recursive query ) Nonlinear & Mutual Recursion
4
Jennifer Widom Linear Recursion With Recursive R As ( base query Union recursive query ) Nonlinear & Mutual Recursion
5
Jennifer Widom Example: Ancestors ParentOf(parent,child) Find all of Mary’s ancestors Nonlinear & Mutual Recursion
6
Jennifer Widom Example: Ancestors ParentOf(parent,child) Find all of Mary’s ancestors Nonlinear & Mutual Recursion
7
Jennifer Widom Example: Ancestors ParentOf(parent,child) Find all of Mary’s ancestors Nonlinear (versus linear) + Query looks cleaner + Converges faster – Harder to implement SQL standard only requires linear Nonlinear & Mutual Recursion
8
Jennifer Widom SQL With Recursive Statement With Recursive R1 As (query-1), R2 As (query-2),... Rn As (query-n) Nonlinear & Mutual Recursion
9
Jennifer Widom Mutual Recursion With Recursive R1 As (query-1), R2 As (query-2),... Rn As (query-n) Nonlinear & Mutual Recursion
10
Jennifer Widom Example: Hubs & Authorities Link(src,dest) HubStart(node) AuthStart(node) Nonlinear & Mutual Recursion
11
Jennifer Widom Example: Hubs & Authorities Link(src,dest) HubStart(node) AuthStart(node) Nonlinear & Mutual Recursion
12
Jennifer Widom Nonlinear & Mutual Recursion Example: Hubs & Authorities
13
Jennifer Widom Example: Recursion with Aggregation P(x) Nonlinear & Mutual Recursion
14
Jennifer Widom SQL With Recursive Statement Extends expressiveness of SQL Basic functionality: linear recursion Extended functionality: nonlinear recursion, mutual recursion Disallowed: recursive subqueries (negative), aggregation With Recursive R1 As (query-1), R2 As (query-2),... Rn As (query-n) Nonlinear & Mutual Recursion
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.