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.89) (envelope-from ) id 1j4P5r-00044g-NZ for pgsql-performance@arkaria.postgresql.org; Wed, 19 Feb 2020 13:08:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j4P5q-0005To-HE for pgsql-performance@arkaria.postgresql.org; Wed, 19 Feb 2020 13:08:46 +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 1j4P5q-0005Th-4O for pgsql-performance@lists.postgresql.org; Wed, 19 Feb 2020 13:08:46 +0000 Received: from mail-yw1-xc42.google.com ([2607:f8b0:4864:20::c42]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j4P5n-000616-Ju for pgsql-performance@lists.postgresql.org; Wed, 19 Feb 2020 13:08:45 +0000 Received: by mail-yw1-xc42.google.com with SMTP id l5so57764ywd.4 for ; Wed, 19 Feb 2020 05:08:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4+VYiGEAifZEVTq73cVHPUxec6niNpH3rrhkaKdZLGE=; b=fffiFbDxjVBbszDFMzN6F3ZHxCejSmOJKpS89ORvP7uFD0SnPzRC4n5D9gKq0bANfR 84CSf5bjwnY2H5fmVdPhf6Qi733udIwou04UCo1RnT4gGODJWk8Iqzs8xSgDr9HY+/vv GJmNf+lBe5DL2ylt/J5EoXQ69CmSPrc2rG6HsmB3ZS9mbz1SkTJDZ3Zo2dqeeIFJ/I0F +U43ZnPYi5ivgCSN/F3h9Cm6nXbiuxuOzbmRhWNGscRjA0vFeLmbRDujfL3NYX9MJXsP rtQvJlSMsgFSqMMlx6Pw1WmRBE7U0GVj003i0N9v0gGhrHeANlRIscEFrL+DHsiKHuA2 MUhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4+VYiGEAifZEVTq73cVHPUxec6niNpH3rrhkaKdZLGE=; b=tfrF+CS/i4g6vUmQMQTtCpAuBeeBZtMKPd3FklIIZZcRX3AD6evbKNN9BVzYlR0AgJ 87lu/QYDuY6GSvLyXcwZtNNmhRGctH/W/8BlMVumAfktciB0gKYKec63IR1Wt5XuKxXK 42Vyx4eTAY5JikzMoJeA82643/bqGza0uo9MexO0iBdqYoxpL5J7QxhuQy6SK043IK+8 d7amb+dQg7qQKwm05GkM0ow0sGSiQKcLwDfgiNNQmI2zLRU9FtHImW5whg6m91kD1HDn W/LF2uGQPWu1lfY8iA1Rdf3LdenTOTSK+Df6SmxmUO/1ErnY+B7l8nH0Oc3CKlGKFBWx HH0g== X-Gm-Message-State: APjAAAXH2RPrTvWBCkrFyaxZSpj2HEF/3pTHLjkKGWKmvRmqRyly7/Wq dKJl3/P7H41PZofvjryxJhQrNb7y7o8= X-Google-Smtp-Source: APXvYqws5At4JkmxdManq7+o/8HTlY4kiqvO0noQ1gR3SdQ/1X4C5Citnv0GiQ2cHB2PclnIQ8Zixw== X-Received: by 2002:a81:7841:: with SMTP id t62mr20927082ywc.140.1582117721519; Wed, 19 Feb 2020 05:08:41 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id 141sm1009939yws.54.2020.02.19.05.08.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Feb 2020 05:08:40 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 05316800828; Wed, 19 Feb 2020 07:08:38 -0600 (CST) Date: Wed, 19 Feb 2020 07:08:38 -0600 From: Justin Pryzby To: Nicolas PARIS Cc: pgsql-performance@lists.postgresql.org Subject: Re: tablespace to benefit from ssd ? Message-ID: <20200219130838.GI31889@telsasoft.com> References: <87ftf7fari.fsf@riseup.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ftf7fari.fsf@riseup.net> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Feb 19, 2020 at 05:42:41AM +0100, Nicolas PARIS wrote: > Hi > > I have both hdd and ssd disk on the postgres server. The cluster is > right now created on the hdd only. I am considering using a tablespace > to put some highly used postgres object on the ssd disk. Of course the > ssd is small compared to the hdd, and I need to choose carefully what > objects are stored on that side. > > I am wondering what kind of object (indexes, data) would benefit from > ssd. The database primary/foreign keys are highly used and there is > almost no sequencial scan. However the server has a large amount of ram > memory and I suspect all of those indexes are already cached in ram. > > I have read that tablespaces introduce overhead of maintenance and > introduce complication for replication. But on the other hand I have > this ssd disk ready for something. To start with, you can: ALTER SYSTEM SET temp_tablespaces='ssd'; That will improve speed of sorts which spill to disk (if any). +1 to using LVM for purposes of instrumentation. You can also: ALTER TABLESPACE ssd SET (random_page_cost=1.0); It'd be difficult to suggest anything further without knowing about your workload or performance goals or issues. -- Justin