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 1jGBu1-0007eS-Hj for pgsql-performance@arkaria.postgresql.org; Mon, 23 Mar 2020 01:29:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jGBu0-0000SG-3x for pgsql-performance@arkaria.postgresql.org; Mon, 23 Mar 2020 01:29:16 +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 1jGBtz-0000S9-LU for pgsql-performance@lists.postgresql.org; Mon, 23 Mar 2020 01:29:15 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jGBts-0002cO-Iq for pgsql-performance@lists.postgresql.org; Mon, 23 Mar 2020 01:29:15 +0000 Received: by mail-qk1-x744.google.com with SMTP id h14so13746725qke.5 for ; Sun, 22 Mar 2020 18:29:07 -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=lHzXA2a6QGdwMS+x6bQnBzrHzATqburySjXanYU2QVI=; b=eAz7U2vguL+ACIxYIplvWduxhQmBIu/ZdYZWEqyjVbtaBYHpEEzZLWuVEuwxN6dEEB ResumV/cJ1UgRxIiJzpaAz81o/XTL6K4k+ykiIz70NRoV7Qib6T+3Z7GrHqzkj0dCyrR FoOCiE/174P/qpMyfvn1WT3fm9ABZteRqmL+cBbnJAtFiVrWiG0qsd0O9gaOokZQYMG7 S3damLNYRsEm6wrnEB4C/HRHoFIzLRDdH2mH/RLZPrieuJXdn91pioI7EtvF8lnCdf2r a1UhiZPEbsz7SEsJXSq3ThCRSGh6XXNKc3de7BgB19DZet8Yp/FP2z9z6JoXRHXvQrE9 13Cw== 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=lHzXA2a6QGdwMS+x6bQnBzrHzATqburySjXanYU2QVI=; b=go4c39BwFJ4/eWtdF5qz+AkGYC9VWhD67obt8x+yUETRXojRJ4cJaVVgbbvghweesg C4c/5wCSTlsPKdm8VaqbxhXSPsXC+/C5R2wRK0PZv7GcntPAYSmKobWwb55vgZSGV2rL gQLn1kUrye4zM5Inv1KEqYoJid4uYLKjecCM9YKx8zUtl7aEM9oo30SDROk7w7jRMYl6 lkfiz4QzQZs0WK0BtMH6hUmya/j4EYjZElgSp+tFqVRXxZoGLINkL8A5Uk9ndYLlpwGf zcK4YEHN+LP8G34vNXsTWXKYzXPvdsetqaVj4RgxWhqHbForVo7XRCOgL4caGNq8XIF4 qvJg== X-Gm-Message-State: ANhLgQ2H7PgB3852+SBF0oN3Yl1CjxSjqErcYaJo90h5iF5sxFlD2cRL gA+Em3tj/0mMsQ87s+PodVZcLg== X-Google-Smtp-Source: ADFU+vtKv7OJuralfFs5ud7beUAI75NtjaKpF+0aI+pF/GG714rLhlZyiRP+rYea07xoIqpmUURIwA== X-Received: by 2002:a37:b285:: with SMTP id b127mr18620676qkf.413.1584926946466; Sun, 22 Mar 2020 18:29:06 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id 4sm5782174qkl.51.2020.03.22.18.29.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Mar 2020 18:29:05 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 528CE800CF1; Sun, 22 Mar 2020 20:29:04 -0500 (CDT) Date: Sun, 22 Mar 2020 20:29:04 -0500 From: Justin Pryzby To: Arya F Cc: pgsql-performance@lists.postgresql.org Subject: Re: Partitions to improve write/update speed for tables with indexes? Message-ID: <20200323012904.GG2563@telsasoft.com> References: 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 Sun, Mar 22, 2020 at 09:22:50PM -0400, Arya F wrote: > I have noticed that my write/update performance starts to dramatically > reduce after about 10 million rows on my hardware. The reason for the > slowdown is the index updates on every write/update. It's commonly true that the indexes need to fit entirely in shared_buffers for good write performance. I gave some suggestions here: https://www.postgresql.org/message-id/20200223101209.GU31889%40telsasoft.com > The solution would be partitioning? One of my tables will have more > than 1 billion rows of data, so I would have to create about 100 > partitions for that table. Is the a practical limit to the amount of > partitions I can have with Postgresql 12? The recommendation since pg12 is to use at most a "few thousand" partitions, so for the moment you'd be well within the recommendation. https://www.postgresql.org/docs/12/ddl-partitioning.html -- Justin