Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sVt68-00CAWa-86 for pgsql-admin@arkaria.postgresql.org; Mon, 22 Jul 2024 13:29:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sVt66-001skq-6z for pgsql-admin@arkaria.postgresql.org; Mon, 22 Jul 2024 13:29:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sVt65-001ski-ST for pgsql-admin@lists.postgresql.org; Mon, 22 Jul 2024 13:29:02 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sVt63-000seK-J7 for pgsql-admin@lists.postgresql.org; Mon, 22 Jul 2024 13:29:01 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id C04DE61935; Mon, 22 Jul 2024 13:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1721654936; bh=0YjzFb12dsuPKDDqOrG62jQW6VXuVN48pJBtwkFb7xs=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=k4GESkrCpkdrs43qnC3NloqlBtNA0jOw3E0Z4+LcG1dnxGWwnd3umARA3es6nso7A OaFSaVktIi3q5fQH6N+AUicT6jY7RwFhIBdDEhoyfjMf/2g8C0TzZxpGIwqKKNNMaw tY7Zkdvz/mNTKUx50J71fQ21qlNMh7vdpLfAOcmsDcEl4lMEaParYQr3R3XVZj5wI6 gmg/11CAex/oNlJ73e+QBE0jqhHEwnNW2KLMPliTVk2xpoXO7Wsd6qUW0AvV4pG6od FGmCT9vKH7PWhOPcbOv4MA3Uh7p4J/Wsnd7DE4zIOSctvSzXoNaxXsOcXp7faJOSLJ ahioHqkU0XBaw== X-Virus-Scanned: Debian amavisd-new at emo07-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo07-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kULjlmOoPHPT; Mon, 22 Jul 2024 13:28:56 +0000 (UTC) Received: from smtpclient.apple (unknown [165.140.184.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 32ACC61889; Mon, 22 Jul 2024 13:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1721654936; bh=0YjzFb12dsuPKDDqOrG62jQW6VXuVN48pJBtwkFb7xs=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=k4GESkrCpkdrs43qnC3NloqlBtNA0jOw3E0Z4+LcG1dnxGWwnd3umARA3es6nso7A OaFSaVktIi3q5fQH6N+AUicT6jY7RwFhIBdDEhoyfjMf/2g8C0TzZxpGIwqKKNNMaw tY7Zkdvz/mNTKUx50J71fQ21qlNMh7vdpLfAOcmsDcEl4lMEaParYQr3R3XVZj5wI6 gmg/11CAex/oNlJ73e+QBE0jqhHEwnNW2KLMPliTVk2xpoXO7Wsd6qUW0AvV4pG6od FGmCT9vKH7PWhOPcbOv4MA3Uh7p4J/Wsnd7DE4zIOSctvSzXoNaxXsOcXp7faJOSLJ ahioHqkU0XBaw== Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: small temp files From: Scott Ribe In-Reply-To: Date: Mon, 22 Jul 2024 07:28:45 -0600 Cc: pgsql-admin@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <8E03B792-C389-456D-913D-4F2B0EBB903E@elevated-dev.com> References: <7A0C9A69-5632-4CFC-B156-53FAAAB33E26@elevated-dev.com> To: Holger Jakobs X-Mailer: Apple Mail (2.3774.600.62) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jul 22, 2024, at 7:00=E2=80=AFAM, Holger Jakobs = wrote: >=20 > Typically, queries which need a lot of memory (RAM) create temp files = if work_mem isn't sufficient for some sorting or hash algorithms. >=20 > Increasing work_mem will help, but small temp files don't create any = trouble. >=20 > You can set work_mem within each session, don't set it high globally. I understand those things--my question is why, with work_mem set to = 128MB, I would see tiny temp files (7452 is common, as is 102, and I've = seen as small as 51).