Re: BUG #18909: Query creates millions of temporary files and stalls

Andrei Lepikhov <lepihov@gmail.com>

From: Andrei Lepikhov <lepihov@gmail.com>
To: Sergey Koposov <Sergey.Koposov@ed.ac.uk>, "tgl@sss.pgh.pa.us" <tgl@sss.pgh.pa.us>
Cc: "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2025-05-03T17:56:53Z
Lists: pgsql-bugs
On 3/5/2025 18:52, Sergey Koposov wrote:
> On Sat, 2025-05-03 at 12:27 -0400, Tom Lane wrote:
>> Yeah, this confirms the idea that the hashtable has exploded into an
>> unreasonable number of buckets and batches.  I don't know why a
>> parallel hash join would be more prone to do that than a non-parallel
>> one, though.  I'm hoping some of the folks who worked on PHJ will
>> look at this.
> Here're  my memory settings
> 
> shared_buffers = 32GB
> work_mem = 1GB
May you show statistics from the pg_statistic table on two columns:
"d.objid" and "gaps1.original_ext_source_id"? At least stanullfrac, 
stadistinct, stawidth and MCV frequencies.

Also, an EXPLAIN ANALYZE on this query, which successfully finished 
execution without parallel workers, might provide quick insights.

-- 
regards, Andrei Lepikhov