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 1jW90Q-00028Z-G1 for pgsql-performance@arkaria.postgresql.org; Wed, 06 May 2020 01:37:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jW90P-0005BD-5R for pgsql-performance@arkaria.postgresql.org; Wed, 06 May 2020 01:37:49 +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 1jW90O-00056Q-QR for pgsql-performance@lists.postgresql.org; Wed, 06 May 2020 01:37:48 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jW90L-0004dZ-6K for pgsql-performance@lists.postgresql.org; Wed, 06 May 2020 01:37:47 +0000 Received: by mail-qk1-x744.google.com with SMTP id b188so397812qkd.9 for ; Tue, 05 May 2020 18:37:45 -0700 (PDT) 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=ZPlV5NuBFVN/kXJnz6GzQM1hvVYDe+v8FXjOwTIASEw=; b=u0DSMclf9azablKyHjUoNfMEha0xiZolV4zhXMKaVx01nCO2IVNzs0dP6kepwWA+hd CMcNg5nRQRCuZ0EZfVQtxpdANZ2sL8s1/gvmJ4IXfLCzRQRDjQ/4Ee2KS0ACu3MxWTkl Gk5/d+X0Xw7gzZdakrCVTC7kaRwjx/0/P+1qsMVLXSNIbB3PWLqkjiJxywDluLa18wVj d5SE7Fk4WBoYvQm8R913qfFiNmhKhwgipbP7TXGw4sghKvklvOi9Up/PbhFNhsCmtX/u IO+Koe11vYqUtAPrDvEfSBQ0MTs93HmneGGJMGfA78RnMRXm5eM2EN/e45VXRJXW0Nlx RcEw== 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=ZPlV5NuBFVN/kXJnz6GzQM1hvVYDe+v8FXjOwTIASEw=; b=dAfu6ZnamoAROFKC3FAiqoDvYA9dLdn9gXc70fqcjCA4rjZ/D2JhO74T4CWURIyzDK QraQMyiL0ZRiqHKjDYgD/offcYaTtQCfS8OdFrrQ+1WmOT/puMISXIJUQA/yKpA99Ro2 3SnRqwV5PWNwzWqyBD5beOnmr6C9Ovl6kRGcGcdDOyKHpRVoThseECJckZ7Rqx7ZZ9h5 N0PjZt/hCRgeGNebidRrsVh3l+EOgulfwwTikscWIkPbftAPK5XwsXj7FEJ1rWUP9gaZ SGq1JGppgME+qltMf9xQ7eFP3moHVexHBgu0iWm3JgnamWUzSRQvLV9aAOyr538YsuHu V4iQ== X-Gm-Message-State: AGi0PuZK/qfMrqcwTEubqCon1vIKV9NNcASfJj1Z/ifaOpsGNe4+OXg0 414uqIMGp1s+oIcqH2AbmUG2aw== X-Google-Smtp-Source: APiQypKz325ScBdVwLU5Qy/1Il0tXq5Iki7paMAFep2LtWwBCOiVrOTgcS6rrhj2VncXeysJWCsfiA== X-Received: by 2002:ae9:ef07:: with SMTP id d7mr6596656qkg.229.1588729064179; Tue, 05 May 2020 18:37:44 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id 132sm506946qkj.117.2020.05.05.18.37.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 May 2020 18:37:43 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 71ECA800C5C; Tue, 5 May 2020 20:37:41 -0500 (CDT) Date: Tue, 5 May 2020 20:37:41 -0500 From: Justin Pryzby To: Arya F Cc: Michael Lewis , Pgsql Performance Subject: Re: 600 million rows of data. Bad hardware or need partitioning? Message-ID: <20200506013741.GH28974@telsasoft.com> References: <20200504092130.GN28974@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, May 05, 2020 at 08:31:29PM -0400, Arya F wrote: > On Mon, May 4, 2020 at 5:21 AM Justin Pryzby wrote: > > > I mentioned in February and March that you should plan to set shared_buffers > > to fit the indexes currently being updated. > > The following command gives me > > select pg_size_pretty (pg_indexes_size('test_table')); > pg_size_pretty > 5216 MB > > So right now, the indexes on that table are taking about 5.2 GB, if a > machine has 512 GB of RAM and SSDs, is it safe to assume I can achieve > the same update that takes 1.5 minutes in less than 5 seconds while > having 600 million rows of data without partitioning? I am not prepared to guarantee server performance.. But, to my knowledge, you haven't configured shared_buffers at all. Which I think might be the single most important thing to configure for loading speed (with indexes). Couple months ago, you said your server had 4GB RAM, which isn't much, but if shared_buffers is ~100MB, I think that deserves attention. If you get good performance with a million rows and 32MB buffers, then you could reasonably hope to get good performance (at least initially) with 100million rows and 320MB buffers. Scale that up to whatever you expect your index size to be. Be conservative since you may need to add indexes later, and you can expect they'll become bloated, so you may want to run a reindex job. shared_buffers is frequently set to ~25% of RAM, and if you need to efficiently use indexes larger than what that supports, then you should add RAM, or implement partitioning. -- Justin