> For the complete documentation index, see [llms.txt](https://cs186.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cs186.gitbook.io/project/common/misc/nested-loop-join-animations.md).

# Nested Loop Join Animations

**Key**

* Records highlighted in blue belong to a page in the left relation that is loaded into memory.
* Records highlighted in orange belong to a page in the right relation that is loaded into memory.
* The dark blue and dark orange records are the two records currently being compared to see if they fit the join criteria.
* The purple squares represent which pairs of records have already been considered.

Notice that regardless of the nested loop join implementation, by the time we finish we've considered every pair of records!

## Normal Speed

### Simple Nested Loop Join

![](/files/-MILm2SXP4yanIVGYQIn)

### Page Nested Loop Join

![](/files/-MILm2SYESLP7ap2TkoG)

### Block Nested Loop Join (B=4)

![](/files/-MI714X9aEe4n8mNyLhY)

## x2 Speed

### Simple Nested Loop Join

![](/files/-MILm2SZJ9fWf5ILQRS7)

### Page Nested Loop Join

![](/files/-MILm2S_Zh4EaNJw07H5)

### Block Nested Loop Join (B=4)

![](/files/-MILm2SaeFuECDbHyFIe)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cs186.gitbook.io/project/common/misc/nested-loop-join-animations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
