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 1njQTi-000678-02 for pgsql-admin@arkaria.postgresql.org; Tue, 26 Apr 2022 19:04:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1njQTg-00081E-Up for pgsql-admin@arkaria.postgresql.org; Tue, 26 Apr 2022 19:04:00 +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 1njQTg-000815-K7 for pgsql-admin@lists.postgresql.org; Tue, 26 Apr 2022 19:04:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1njQTe-0001RB-AZ for pgsql-admin@postgresql.org; Tue, 26 Apr 2022 19:03:59 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 23QJ3uoN254726; Tue, 26 Apr 2022 15:03:56 -0400 From: Tom Lane To: MichaelDBA cc: Wells Oliver , pgsql-admin Subject: Re: CTEs and temp_buffers? In-reply-to: References: <248032.1650996195@sss.pgh.pa.us> Comments: In-reply-to MichaelDBA message dated "Tue, 26 Apr 2022 14:55:54 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <254724.1650999836.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 26 Apr 2022 15:03:56 -0400 Message-ID: <254725.1650999836@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk MichaelDBA writes: > Hi Tom, > Of course, you're right! I got sidetracked thinking about temp_buffers > with respect to temporary tables and not CTEs where work_mem stuff would > apply.  But back to the temp_buffers thing.  Can you acknowledge that my > thinking is right about that?  That temporary table buffers if exceeding > temp_buffers gets logged to the */base/pgsql_tmp* area and is > not logged in the logs at all?   My testing seems to confirm that. No. Temp tables go into the same directories as regular tables. The files have funny names though, following the format "tN_OID" rather than just "OID". regards, tom lane