Re: Temporary files usage in explain - Mailing list pgsql-general

From Matteo Bonardi
Subject Re: Temporary files usage in explain
Date
Msg-id CAPosY77+0pgmw-F7xr9VzNRUbmvTnVxxe=UK5QzbKjVOyP9rUg@mail.gmail.com
Whole thread Raw
In response to Re: Temporary files usage in explain  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-general

Okay, I had a misconception of the buffers option.
As I reread the documentation, I realized how stupid the question was.

I confirm that with the buffers option I now see:


Buffers: shared hit=9617011 read=1328356 dirtied=793 written=397, temp read=2996659 written=5956399


Thank you both,
Matteo



Il giorno mar 27 apr 2021 alle ore 11:38 David Rowley <dgrowleyml@gmail.com> ha scritto:
On Tue, 27 Apr 2021 at 21:15, Matteo Bonardi <mbona92@gmail.com> wrote:
> Explain plan: https://explain.depesz.com/s/BXGT
>
> Usually I'm looking for "external merge Disk" to see temp files usage but, in this case, the only reference to that is 299,368kB in the last but one node of explain.
> Can anyone help me understand where the 45GB are in that explain?

If you do EXPLAIN (ANALYZE, BUFFERS) you might find that the recursive
CTE is writing the rest of them out.  Something like "temp written =
", likely around 5 million or so, I imagine.

David

pgsql-general by date:

Previous
From: David Rowley
Date:
Subject: Re: Temporary files usage in explain
Next
From: Aleš Zelený
Date:
Subject: Streaming replica failure