Nested Loop

Nested Loop

Der Nested Loop Join ist eine mögliche Strategie in einem Datenbanksystem für Umsetzungen von Joins. Dabei werden nacheinander alle Tupel (Informatik) aus der einen Relation ausgewählt und mit jedem Tupel aus der anderen verglichen.

Beispiel

Für eine Anweisung wie R Join S mit R.a=S.a könnte eine Umsetzung in Pseudocode wie folgt aussehen:

 foreach r in R do
   foreach s in S do 
     if r.a = s.a do
       Ausgabe von (r,s)
     endif
   end foreach
 end foreach      

Bewertung

Da für alle Tupel der Relation R jeweils alle Daten aus B eingelesen werden müßen ergibt sich ein Aufwand von \mathcal{O}(n^2).

Üblicherweise wählen Umsetzungen aus Effizienzgründen die kleinere Relation für die äußere Schleife, weiterhin werden die Tupel aus der inneren meist in Blöcken ausgelesen. Sind die Eingangsmengen gleich groß, wird, je nach Datenbanksystem, eher ein Hash Join eingesetzt werden.

Varianten

Weitere Varianten sind der Block nested Loop Join, bei dem auch bei der Relation R nur Blöcke eingelesen werden, sowie der Index nested Loop Join, bei dem in der inneren Schleife ein Index genutzt wird.


Wikimedia Foundation.

Игры ⚽ Поможем сделать НИР

Schlagen Sie auch in anderen Wörterbüchern nach:

  • Nested Loop Join — Der Nested Loop Join ist eine mögliche Strategie in einem Datenbanksystem für Umsetzungen von Joins. Dabei werden nacheinander alle Tupel (Informatik) aus der einen Relation ausgewählt und mit jedem Tupel aus der anderen verglichen. Beispiel Für… …   Deutsch Wikipedia

  • Nested loop join — A nested loop join is a naive algorithm that joins two relations R and S by making two nested loops: For each tuple r in R do For each tuple s in S do If r and s satisfy the join condition Then output the tuple <r,s> This algorithm will… …   Wikipedia

  • Block nested loop — A block nested loop is an algorithm used to join two relations in a relational database.This algorithm is a variation on the simple nested loop join used to join two relations R and S (the outer and inner join operands, respectively). Suppose |R| …   Wikipedia

  • Loop optimization — In compiler theory, loop optimization plays an important role in improving cache performance, making effective use of parallel processing capabilities, and reducing overheads associated with executing loops. Most execution time of a scientific… …   Wikipedia

  • Nested function — definitions can be compared to how a Matryoshka doll nests within larger versions of itself, in several levels. In computer programming, a nested function (or nested procedure/subroutine) is a function which is lexically (textually) encapsulated… …   Wikipedia

  • Loop nest optimization — (LNO) is a special case of loop transformation, dealing with nested loops, that allows large reductions in the cache bandwidth necessary for some common algorithms.Example: Matrix multiplyMany large mathematical operations on computers end up… …   Wikipedia

  • Loop counter — In software engineering, a loop counter is the term often used to refer to the variable that controls the iterations of a loop (a computer programming language construct). It is so named because most uses of this construct result in the variable… …   Wikipedia

  • Nested function — Fonction imbriquée Une fonction imbriquée ou fonction interne est une fonction encapsulée dans une autre. Elle ne peut être appelée que par la fonction englobante ou par des fonctions imbriquées directement ou non dans la même fonction englobante …   Wikipédia en Français

  • For loop — In computer science a for loop is a programming language statement which allows code to be repeatedly executed. A for loop is classified as an iteration statement.Unlike many other kinds of loops, such as the while loop, the for loop is often… …   Wikipedia

  • Stem-loop — intramolecular base pairing is a pattern that can occur in single stranded DNA or, more commonly, in RNA. The structure is also known as a hairpin or hairpin loop. It occurs when two regions of the same molecule, usually palindromic (reads the… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”