pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sergey Koposov <Sergey.Koposov@ed.ac.uk>
Cc: lepihov@gmail.com <lepihov@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #18909: Query creates millions of temporary files and stalls
Date: Sat, 03 May 2025 18:03:26 -0400
Message-ID: <2216372.1746309806@sss.pgh.pa.us> (raw)
In-Reply-To: <0ce957be37434cfca4820d1e89a70cb2b456d3db.camel@ed.ac.uk>
References: <18909-e5e1b702c9441b8a@postgresql.org>
	<2051617.1746223978@sss.pgh.pa.us>
	<beb051161520fc48248c2f90582eb15c6a71d239.camel@ed.ac.uk>
	<5e98fba645682c40bf5f88ef858963ade9681956.camel@ed.ac.uk>
	<2177960.1746289626@sss.pgh.pa.us>
	<80bab58be182e80e73b5d5f71664ede9ce58f957.camel@ed.ac.uk>
	<8fc51cd7-115a-425a-828e-c99defb5afef@gmail.com>
	<ba927eb7126844c1b964e75cadb774488794dfde.camel@ed.ac.uk>
	<0ce957be37434cfca4820d1e89a70cb2b456d3db.camel@ed.ac.uk>

Sergey Koposov <Sergey.Koposov@ed.ac.uk> writes:
>          ->  Parallel Hash Left Join  (cost=14442102.04..22124798.60 rows=16367717 width=60) (actual time=209805.943..273008.489 rows=13102859 loops=5)
>                Hash Cond: (d.objid = gaps1.original_ext_source_id)
>                ->  Parallel Seq Scan on disk_sample1 d  (cost=0.00..1218371.17 rows=16367717 width=60) (actual time=37.353..25185.340 rows=13095751 loops=5)
>                ->  Parallel Hash  (cost=10307380.24..10307380.24 rows=237862624 width=16) (actual time=169633.067..169633.068 rows=190290095 loops=5)
>                      Buckets: 67108864  Batches: 32  Memory Usage: 1919904kB
>                      ->  Parallel Seq Scan on panstarrs1bestneighbour gaps1  (cost=0.00..10307380.24 rows=237862624 width=16) (actual time=132.295..117548.803
> rows=190290095 loops=5)

Hm, interesting.  The number of batches stayed sane here (32), whereas
it went crazy in the other run.  I wonder if there's something
nondeterministic about that choice in a parallel hash join.

> I don't think I know how to see the plan of the declare cursor query.

EXPLAIN DECLARE c CURSOR FOR SELECT ...

			regards, tom lane





view thread (17+ messages)  latest in thread

Message-ID: <2216372.1746309806@sss.pgh.pa.us>
Permalink:  ../2216372.1746309806@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2216372.1746309806@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Sergey.Koposov@ed.ac.uk, lepihov@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18909: Query creates millions of temporary files and stalls
  In-Reply-To: <2216372.1746309806@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox