Nested loops join - Deepstash

Nested loops join

How: It iterates over all rows from one table and for each of them it searches the matching rows in the other table.

When: It's used for small datasets when the overhead of a more advanced join method is not justified, or when one of the tables has an index on the JOIN condition.

Tip: Ensure you have an index on the JOIN condition.

Complexity:

  • without any indexes: O(M*N) time. O(1) space
  • with indexes: O(M*logN) time. O(1) space

21

43 reads

CURATED FROM

IDEAS CURATED BY

ocpodariu

Alt account of @ocp. I use it to stash ideas about software engineering

Tips to improve the performance of your SQL queries

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Personalized microlearning

100+ Learning Journeys

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates