pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rihad <rihad@mail.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general General <pgsql-general@postgresql.org>
Subject: Re: Quere keep using temporary files
Date: Fri, 25 Oct 2019 19:56:26 +0400
Message-ID: <9a4aa120-0e0c-d546-e939-a99dc47b2a79@mail.ru> (raw)
In-Reply-To: <16916.1572011385@sss.pgh.pa.us>
References: <2c38ebb8-977e-926b-4842-5cf31c4059b2@mail.ru>
	<16916.1572011385@sss.pgh.pa.us>

On 10/25/2019 05:49 PM, Tom Lane wrote:
> rihad <rihad@mail.ru> writes:
>> Hi, we frequently run many query involving XML that use a smallish
>> temporary file, despite having increased local work_mem in that
>> transaction to 16GB. FreeBSD's top shows that the memory isn't actually
>> being used - it remains free. Basically many such queries are run within
>> a single transaction:
>> LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp92452.1079", size 166518
>> STATEMENT:  DELETE FROM "foo" WHERE ((col1, col2, col3) in (select col1,
>> col2, col3 from foo_xml_v2('<here goes xml-formatted blob>'))) AND
>> "foo"."col_id" IN ($1, $2, $3, $4, $5, $6, $7, $8, $9)
>> It looks like increasing work_mem doesn't help. Surely 16GB is enough to
>> cover all these small temp files?
> You'd need to provide a lot more detail about what that query is doing
> for anyone to be able to guess where the temp file usage is coming from.
>
> 			regards, tom lane
> .
>
I just checked and saw that the function "foo_xml_v2" above returns 
table. Is this enough to trigger temporary file usage regardless of 
work_mem?






view thread (5+ messages)  latest in thread

Message-ID: <9a4aa120-0e0c-d546-e939-a99dc47b2a79@mail.ru>
Permalink:  ../9a4aa120-0e0c-d546-e939-a99dc47b2a79@mail.ru/
Also on:    postgresql.org/message-id/9a4aa120-0e0c-d546-e939-a99dc47b2a79@mail.ru

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: rihad@mail.ru, tgl@sss.pgh.pa.us
  Subject: Re: Quere keep using temporary files
  In-Reply-To: <9a4aa120-0e0c-d546-e939-a99dc47b2a79@mail.ru>
  References: <2c38ebb8-977e-926b-4842-5cf31c4059b2@mail.ru> <16916.1572011385@sss.pgh.pa.us> <9a4aa120-0e0c-d546-e939-a99dc47b2a79@mail.ru>

* 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