Joins: Difference between revisions

From Algorithm Wiki
Jump to navigation Jump to search
(Created page with "== Problem Description== An SQL join clause - corresponding to a join operation in relational algebra - combines columns from one or more tables in a relational database. == Bounds Chart == 350px == Step Chart == 350px == Improvement Table == {| class="wikitable" style="text-align:center;" width="100%" !width="20%" | Complexity Classes !! width="40%" | Algorithm Paper Links !! width="40%" | Lower Bounds Pape...")
 
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Problem Description==
{{DISPLAYTITLE:Joins (Joins)}}
An SQL join clause - corresponding to a join operation in relational algebra
== Description ==  
- combines columns from one or more tables in a relational database.


== Bounds Chart ==
An SQL join clause - corresponding to a join operation in relational algebra - combines columns from one or more tables in a relational database.
[[File:JoinsBoundsChart.png|350px]]


== Step Chart ==
== Parameters ==  
[[File:JoinsStepChart.png|350px]]
 
$m,n$: sizes of input tables
 
== Table of Algorithms ==
 
{| class="wikitable sortable"  style="text-align:center;" width="100%"
 
! Name !! Year !! Time !! Space !! Approximation Factor !! Model !! Reference


== Improvement Table ==
{| class="wikitable" style="text-align:center;" width="100%"
!width="20%" | Complexity Classes !! width="40%" | Algorithm Paper Links !! width="40%" | Lower Bounds Paper Links
|-
| rowspan="1" | Exp/Factorial
|
|
|-
|-
| rowspan="1" | Polynomial > 3
 
|
| [[Nested loop join ( Joins)|Nested loop join]] || 1960 || $O(nm)$ || $O({1})$ || Exact || Deterministic ||
|
|-
|-
| rowspan="1" | Cubic
| [[Sort merge join ( Joins)|Sort merge join]] || 1960 || $O(nlogn + mlogm)$ || $O(n+m)$? || Exact || Deterministic || 
|
|
|-
|-
| rowspan="1" | Quadratic
| [[Hash join ( Joins)|Hash join]] || 1960 || $O(n+m)$ || $O(n+m)$? || Exact || Deterministic || 
|
|
|-
|-
| rowspan="1" | nlogn
|}
|
 
|
== Time Complexity Graph ==
|-
 
| rowspan="1" | Linear
[[File:Joins - Time.png|1000px]]
|
|
|-
| rowspan="1" | logn
|
|
|-|}

Latest revision as of 10:07, 28 April 2023

Description

An SQL join clause - corresponding to a join operation in relational algebra - combines columns from one or more tables in a relational database.

Parameters

$m,n$: sizes of input tables

Table of Algorithms

Name Year Time Space Approximation Factor Model Reference
Nested loop join 1960 $O(nm)$ $O({1})$ Exact Deterministic
Sort merge join 1960 $O(nlogn + mlogm)$ $O(n+m)$? Exact Deterministic
Hash join 1960 $O(n+m)$ $O(n+m)$? Exact Deterministic

Time Complexity Graph

Joins - Time.png