nested loop joins

From: Greg Rychlewski <greg(dot)rychlewski(at)gmail(dot)com>
To: pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: nested loop joins
Date: 2021-10-26 18:47:50
Message-ID: CAKemG7Xi_3eS+wT97ENWbzAmpwoVHJ5=YbQQcnswo5G5qHaNMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

I'm looking to understand how nested loop joins with limits work. Say I
have this query

SELECT *
FROM a INNER JOIN b ON a.id = b.id
LIMIT 10;

Say this was done as a nested loop join where the rows of "a" are the outer
loop.

In this scenario, would all the rows of "a" be materialized or are they
lazily evaluated?

If they are lazily evaluated is it done using cursors?

Thanks

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2021-10-26 18:56:12 Re: nested loop joins
Previous Message Alexey M Boltenkov 2021-10-23 13:59:19 Re: Strange sequences - how to construct?