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.92) (envelope-from ) id 1jEKLF-0007y1-IC for pgsql-general@arkaria.postgresql.org; Tue, 17 Mar 2020 22:05:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jEKLD-0000Lv-Vb for pgsql-general@arkaria.postgresql.org; Tue, 17 Mar 2020 22:05:39 +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 1jEKLD-0000Ln-8o for pgsql-general@lists.postgresql.org; Tue, 17 Mar 2020 22:05:39 +0000 Received: from resqmta-ch2-03v.sys.comcast.net ([2001:558:fe21:29:69:252:207:35]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jEKL9-0002OL-9M for pgsql-general@lists.postgresql.org; Tue, 17 Mar 2020 22:05:38 +0000 Received: from resomta-ch2-08v.sys.comcast.net ([69.252.207.104]) by resqmta-ch2-03v.sys.comcast.net with ESMTP id EKCuj5upK8K6OEKL3jvXj3; Tue, 17 Mar 2020 22:05:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1584482729; bh=961ZFTW3zM7ygPvD8TjNgvCcVaW4/yLIOpamAv1A9Bs=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=S9TYrzV2oKNz2aIJ9mZVo4iZVrqeHCp/olDiPBGB0dF2X4MM7GWTYTZMlAttYFExq 0+1QOHECh6tUQstNcXjtO9mUh0rtjZPZwWcsWv3TvKgX4f8jNmSOEx+DLDX/QTR4X0 eKRAbQ0tPidSMG2tjfygmTrrRll1uRj87yU3WT7KG+zh6kfxx0ueLunNnFLrJsDhUf no5iVnL5BNKHXwyoAHWUv9gaSLP5ntw+YJPQJjgM5xUHdB/ALcGNpbVX+t1zuL4p2f Yw6ZiVNLcm5w7Gh8YYr81ZgjkpgmRjUoMofuK6CaclS6swQ768iZcyMqqF4ETdrU9n rWL1V7IQoQuGQ== Received: from jsievers.comcast.net ([12.30.159.20]) by resomta-ch2-08v.sys.comcast.net with ESMTPA id EKKrjMdtRGi8AEKKsjaX4a; Tue, 17 Mar 2020 22:05:27 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedugedrudefhedgudegkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevohhmtggrshhtqdftvghsihdpqfgfvfdppffquffrtefokffrnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfgvrhhrhicuufhivghvvghrshcuoehgshhivghvvghrshduleestghomhgtrghsthdrnhgvtheqnecukfhppeduvddrfedtrdduheelrddvtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehjshhivghvvghrshdrtghomhgtrghsthdrnhgvthdpihhnvghtpeduvddrfedtrdduheelrddvtddpmhgrihhlfhhrohhmpehgshhivghvvghrshduleestghomhgtrghsthdrnhgvthdprhgtphhtthhopehlrghurhgvnhiirdgrlhgsvgestgihsggvrhhtvggtrdgrthdprhgtphhtthhopegurghnihgvlhdrfigvshhtvghrmhgrnhhnsegusghiqdhsvghrvhhitggvshdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-Xfinity-VMeta: sc=-100.00;st=legit Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id B033C26005A; Tue, 17 Mar 2020 17:05:17 -0500 (CDT) From: Jerry Sievers To: Laurenz Albe Cc: "Daniel Westermann \(DWE\)" , "pgsql-general\@lists.postgresql.org" Subject: Re: Temporary tablespaces on a RAM disk References: <920a66f7c939c5a59f50d62d4b3979e82c25ff21.camel@cybertec.at> Date: Tue, 17 Mar 2020 17:05:17 -0500 In-Reply-To: (Laurenz Albe's message of "Tue, 17 Mar 2020 22:05:20 +0100") Message-ID: <874kum7i3m.fsf@jsievers.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Laurenz Albe writes: > On Tue, 2020-03-17 at 19:57 +0000, Daniel Westermann (DWE) wrote: > >> >> is someone using temporary tablespaces on a RAM disk ? Any experiences with that? >> >> I did some quick tests and checked the archives but could not find any >> >> information that either confirmed it is a bad idea nor the opposite. >> >> >Taking a step back, wouldn't it be better to increase "work_mem" >> >and "temp_buffers" and set "temp_file_limit", so that temporary >> >files are avoided whenever possible and temporary tables are cached? >> >> I don't think you can avoid that for all cases, especially when working >> with large data sets. That was one of the reasons for my initial question. > > But with your proposed setup, any query that needs more temp space > than your RAM disk has will fail. I don't think that is good for large > data sets. Perhaps not, but disk filling on the same volume as WAL is also a serious problem in case the process that eventually took the storage to 100% and got an ENoSpace was the WAL write :-) Er, but any standard 1-tablespace configuration is at risk of that, generally. FWIW > > Setting "work_mem" and "temp_buffers" high, you can use all the RAM > you have, and if it still is not enough, it spills to disk rather than die. > > Yours, > Laurenz Albe > > > > -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net