Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNuuk-0006ou-BH for pgsql-general@arkaria.postgresql.org; Fri, 25 Oct 2019 08:25:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iNuuj-0002Qx-1z for pgsql-general@arkaria.postgresql.org; Fri, 25 Oct 2019 08:25:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNusC-0007I0-Hf for pgsql-general@lists.postgresql.org; Fri, 25 Oct 2019 08:23:04 +0000 Received: from smtp38.i.mail.ru ([94.100.177.98]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNusA-0002wG-6z for pgsql-general@postgresql.org; Fri, 25 Oct 2019 08:23:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:Message-ID:Subject:From:To; bh=BR9R7w0umUvdeWx7w//Gq/t3sZY8P43T48wSc00JTg0=; b=PpPFikrOUcyPg3Qh75jPYILgM/PG/fYTV85m+IxwsBWK08FiTnmMpwek2gpbT+zZR2K0ocbTAGofRij6JFWG+W+Yz+fzRr6S80L6BOxlcofy96di/Wt0CyNGPTZffQUNMM1EPwyKzRiKbq89VhPptZqu62tOZPQdjawePTZR4ZU=; Received: by smtp38.i.mail.ru with esmtpa (envelope-from ) id 1iNus8-0007Ml-Bp for pgsql-general@postgresql.org; Fri, 25 Oct 2019 11:23:00 +0300 To: pgsql-general General From: rihad Subject: Quere keep using temporary files Message-ID: <2c38ebb8-977e-926b-4842-5cf31c4059b2@mail.ru> Date: Fri, 25 Oct 2019 12:22:58 +0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Authentication-Results: smtp38.i.mail.ru; auth=pass smtp.auth=rihad@mail.ru smtp.mailfrom=rihad@mail.ru X-77F55803: 257C4F86AB09C89C5A78504BD2AC2941988784FC6C4AE31F64DCFF329D400975D9F88F8F8FB3F7C4092846DCA4CAC3AD314F1B6D59B834B1 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE797B5CF030A09FB5CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063710E79C3002ED309D8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC2F4F95B9F7323B1652E24E4F89E6E299B97021A4A6026056389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C036A2807E4187C3608941B15DA834481FCF19DD082D7633A0E7DDDDC251EA7DABA471835C12D1D977725E5C173C3A84C351672B98BD86E645117882F4460429728AD0CFFFB425014E40A5AABA2AD371193AA81AA40904B5D9A18204E546F3947CA09ADEE969FA4D8B03F1AB874ED890284AD6D5ED66289B52E1A3F18E62937ED6A8C29749A63C2581725E5C173C3A84C3A59714BA635F5B4DBA3038C0950A5D36B5C8C57E37DE458B5A02E28F51ECAD4422CA9DD8327EE4930A3850AC1BE2E73518CE6D6852B55C3B5C3A97F8350B4230731C566533BA786A40A5AABA2AD371193C9F3DD0FB1AF5EBE26B79914A659FB62623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-Mailru-Sender: B19AB4DAF1EA2FB590F47ADE0BFBE80BC014738725E054552D8EA9835F1B3BBFFAE0F39DAEFF91F0108F17C94788D7333DDE9B364B0DF2891F953FB4A677E77772D6B4FCE48DF648AE208404248635DF X-Mras: OK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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(''))) 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?