Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfH0x-0002ik-8d for pgsql-admin@arkaria.postgresql.org; Thu, 23 Mar 2023 09:13:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pfH0w-00068r-6P for pgsql-admin@arkaria.postgresql.org; Thu, 23 Mar 2023 09:13:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfH0v-00068i-RW for pgsql-admin@lists.postgresql.org; Thu, 23 Mar 2023 09:13:41 +0000 Received: from mout.perfora.net ([74.208.4.197]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfH0p-0005Iz-9D for pgsql-admin@lists.postgresql.org; Thu, 23 Mar 2023 09:13:40 +0000 Received: from smtpclient.apple ([98.169.214.209]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0MaYs3-1pv0br1cyn-00K7Co; Thu, 23 Mar 2023 10:13:30 +0100 Content-Type: multipart/alternative; boundary=Apple-Mail-031A71FD-D870-4F9F-A9F8-3681C52C9DE9 Content-Transfer-Encoding: 7bit From: "Michaeldba@sqlexec.com" Mime-Version: 1.0 (1.0) Subject: Re: Prepared statements generating a lot of temp files. Date: Thu, 23 Mar 2023 05:13:19 -0400 Message-Id: <5267BF6F-73F8-4B94-94EA-F1A6A84DB5EB@sqlexec.com> References: <1870db7265d.f259eb2750325.860651782313663792@zohocorp.com> Cc: pgsql-admin In-Reply-To: <1870db7265d.f259eb2750325.860651782313663792@zohocorp.com> To: Karthik Krishnakumar X-Mailer: iPad Mail (20D67) X-Provags-ID: V03:K1:vWbPZdzwufkCHEYjk5HhokXus842LzcoqYCTL29gs/OPbGxcRIq JTwUSpStlfhVxyxHkpqI9jWqXwJelnpcsEH4P4HsgMRnQ7e4j4g3mvwAvCxqyBMVEKM/Enm pdPtSIQBDF1F3cs2x1QJshtJV7xJ/t1AsMYBB2Dsc3m6/thX3CrOyoT7Dc1ouC4RShRpW7y WfF1mXSRtOdyq5HSONSAw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:dowsE0vQ1ho=;BrGnLPHqZs/umiINhb2Q8MdzE64 ve89bsj7qD8W1tBX74c8LPTUIl0bxf+AfjRkXEaqNMqRz9BEIsGpcy1+XxyNP3lJ1Id07XFNe LxG9JpL8G4m9xHssFHOD23ymkenpcVVrWHhGSaPMwWn/YPQUKAbzLG/e82JWmrzPpZsbQihL4 pKgcUBsnMMWTJ1hX2VgE5Y7kcPNz/zBIDjMaomIdpG8iSxv4W87D3Q8H15r8VP5RKo7gbGi++ SqmQoDIwiwWFea2eZp7knWLgQshJtwVkrsd1+B2yWLeWg2HzFPU5CnnalASVxJkpd/XEniys5 mqlzuSDf1iPEsLNrqNNw6EhkwI4TGa+58jF9/F09CnmH8BwWbDMS4L8peBJpRn8Ddcm/SzV84 +mJcsIKodou8VThiToxQofhRoGHIdKYnzYAUAioYwImrSz5lWMybJ6GjZQxV1bHOXZM9SRLUP Bm/ny+SkTIu/yYrg0eI8lrJlMrFnR05ug6lJhMd+jo5fmHfVuCG1B9oIBu8c7VWLIN5NVUb++ YwRt4Cbmsnc5KccpRGalwpM2NzrZl9vDxM2Ze9Td+m6Otqmx9cWAVKorX6qVUxBOUsbCf36lU +joutVSN9eLauEnLZpUAdEISrQRpZUnX+FdFpLRcgatu+P2xoVs0p86rbCVgSCTCZuMzk8XVF cm+H9/6fU6THz0flFGOxvEi9Fu1a14tFEglfmPvp1Q== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail-031A71FD-D870-4F9F-A9F8-3681C52C9DE9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Look at the size of the bind variables and also whether you are doing bulk i= nserts Sent from my iPad > On Mar 23, 2023, at 5:10 AM, Karthik Krishnakumar w= rote: >=20 > =EF=BB=BF > Hi admins,=20 >=20 > I am analyzing temp files being generated using pg_badger. > Under "queries generating the most temporary files", I am finding insert/u= pdate queries (via prepared statements) writing a lot of data to temp files.= > I am trying to figure why inserts are generating such temp files. > Why are inserts/updates generating temp files? > what can be done to avoid this ? >=20 > thanks,=20 > karthik >=20 --Apple-Mail-031A71FD-D870-4F9F-A9F8-3681C52C9DE9 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Look at the size of the bind variables and a= lso whether you are doing bulk inserts

Sent from my i= Pad

On Mar 23, 2023, at 5= :10 AM, Karthik Krishnakumar <karthikk@zohocorp.com> wrote:

=EF=BB=BF
Hi admins,

I am analyz= ing temp files being generated using pg_badger.
Under "queries= generating the most temporary files", I am finding insert/update queries (v= ia prepared statements) writing a lot of data to temp files.
I= am trying to figure why inserts are generating such temp files.
Why are inserts/updates generating temp files?
what can be= done to avoid this ?

thanks,
ka= rthik

= --Apple-Mail-031A71FD-D870-4F9F-A9F8-3681C52C9DE9--