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 1jEJOy-00054r-5K for pgsql-general@arkaria.postgresql.org; Tue, 17 Mar 2020 21:05:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jEJOv-0005tT-5F for pgsql-general@arkaria.postgresql.org; Tue, 17 Mar 2020 21:05:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jEJOu-0005tM-O5 for pgsql-general@lists.postgresql.org; Tue, 17 Mar 2020 21:05:24 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jEJOs-0006kr-G5 for pgsql-general@lists.postgresql.org; Tue, 17 Mar 2020 21:05:23 +0000 Received: by mail-wm1-x330.google.com with SMTP id 25so862720wmk.3 for ; Tue, 17 Mar 2020 14:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=/WxdqCOE3iSY26zTdm++FZIfmaalV2IWtzLKLICF22o=; b=qVGVKrgpl4jHGcvSkBE/SHv3E7H74R6yQDkUQieig0EJNMli3CZ9NzTummTf7dYL5r eSrw8gYZmfD1HyOFJx+bexQ6iZy1dL7XpWvNq6uDMc5wqirpMFegw+S7BF1kXZHlq/pJ 1YQ/QuTwJRa6LdOfYi29NU8dbeQqla4LuPAFU90izznBdhi5vXm4rkopFkHLelnMYsMf utvuBmlkZieBguQLWw3M8Bre9pieTl44Q2RwB74i/wfbC+CSdPO0zRRtY1Os8+1x64BY 5a7QAwWA8raVnNGyzvto8US/faiiuMvvuyOuyFFKOFox8mpSI/I+6YNW+NFGotBfJII5 BG5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=/WxdqCOE3iSY26zTdm++FZIfmaalV2IWtzLKLICF22o=; b=BKD9pFzUMjspSc/asCTnWqijCPo2pr1fkqC6ZiVwhf+HuVqm4SrvBSk801UU/AxCco 4N+a/yDzmbCL6dLpVl7GWtQuks9wGEt1ddwgxDcIv5w34L2/ny5dO0AfmVAv9t9WNt5w smdLHrjft+HuJKkOqXohWMD2IqcV9WI9NEHaxwV0uIksFvuJGwUuIdwYXcrSGH/ffzoB CJphy8rpmZcJqU4XRt9CyWea9wMLa/8InvMy6K+0sYY3nri4tdn+rPfQ+ziwagdrPqNb 3MsZMWj1kpWdUBxMtlEGpkJ6T26YcrbhbCEpWZpybcQ20cqbks28PMt9EoNDraL1vvCM ryIQ== X-Gm-Message-State: ANhLgQ1DJWzBDTgRTtpazJ1RLTasbbvtfPlkLT73iKvKESG9AqLsC5z7 VWC9h5lc9dIhNrgKhBXMoVN2pw== X-Google-Smtp-Source: ADFU+vvOYxlBfJqaWJbHTI1+/lsB/Jfw2akPi33tcrLs4wehfceGhvuGTQ4wX1yluPMcKuyR1scpDA== X-Received: by 2002:a1c:1d15:: with SMTP id d21mr878309wmd.101.1584479121212; Tue, 17 Mar 2020 14:05:21 -0700 (PDT) Received: from localhost.localdomain (p50992f7c.dip0.t-ipconnect.de. [80.153.47.124]) by smtp.gmail.com with ESMTPSA id n10sm6398078wro.14.2020.03.17.14.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 14:05:20 -0700 (PDT) Message-ID: Subject: Re: Temporary tablespaces on a RAM disk From: Laurenz Albe To: "Daniel Westermann (DWE)" , "pgsql-general@lists.postgresql.org" Date: Tue, 17 Mar 2020 22:05:20 +0100 In-Reply-To: References: ,<920a66f7c939c5a59f50d62d4b3979e82c25ff21.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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. 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