Re: small temp files - Mailing list pgsql-admin

From Scott Ribe
Subject Re: small temp files
Date
Msg-id 16C7116A-2CB2-4909-8830-2FA16470EE27@elevated-dev.com
Whole thread Raw
In response to Re: small temp files  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin
> On Jul 22, 2024, at 8:54 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> You would get more specific answers if you provided an example of the
> queries that cause this, with EXPLAIN ANALYZE output.  But I think a
> likely bet is that it's doing a hash join that overruns work_mem.
> What will happen is that the join gets divided into batches based on
> hash codes, and each batch gets dumped into its own temp files (one
> per batch for each side of the join).  It would not be too surprising
> if some of the batches are small, thanks to the vagaries of hash
> values.  Certainly they could be less than work_mem, since the only
> thing we can say for sure is that the sum of the temp file sizes for
> the inner side of the join should exceed work_mem.

OK, that makes total sense, and fits our usage patterns. (Lots of complex queries, lots of hash joins.)

thanks




pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: small temp files
Next
From: Wasim Devale
Date:
Subject: WAL file corruption on standby PostgreSQL