Disk usage for intermediate results in join

Started by Parul Lakkadalmost 12 years ago3 messages
#1Parul Lakkad
parul.lakkad@gmail.com

Hi,

I am trying to figure out when disk is used to store intermediate results
while performing joins in postgres.

According my findings using 'explain analyse ' only merge sort uses disk.
Can anyone please throw some more light on this?

Thanks,
Parul

#2Heikki Linnakangas
hlinnakangas@vmware.com
In reply to: Parul Lakkad (#1)
Re: Disk usage for intermediate results in join

On 03/11/2014 01:24 PM, Parul Lakkad wrote:

Hi,

I am trying to figure out when disk is used to store intermediate results
while performing joins in postgres.

According my findings using 'explain analyse ' only merge sort uses disk.
Can anyone please throw some more light on this?

Hash joins will also spill to disk if the hash-side of the join is large
enough. The planner usually tries to avoid it, but sometimes it happens.

- Heikki

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Marti Raudsepp
marti@juffo.org
In reply to: Parul Lakkad (#1)
Re: Disk usage for intermediate results in join

On Tue, Mar 11, 2014 at 1:24 PM, Parul Lakkad <parul.lakkad@gmail.com> wrote:

I am trying to figure out when disk is used to store intermediate results
while performing joins in postgres.

Joins can also cause a Nested Loop+Materialize plan, which spills to
disk if the materialize result set is too large for work_mem.

Regards,
Marti

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers