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 1kpk3z-0004yk-P3 for pgsql-general@arkaria.postgresql.org; Thu, 17 Dec 2020 03:34:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kpk3y-0005U5-OQ for pgsql-general@arkaria.postgresql.org; Thu, 17 Dec 2020 03:34:46 +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 1kpk3y-0005Tx-BQ for pgsql-general@lists.postgresql.org; Thu, 17 Dec 2020 03:34:46 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kpk3r-0005zv-Dl for pgsql-general@postgresql.org; Thu, 17 Dec 2020 03:34:45 +0000 Received: by mail-ed1-x534.google.com with SMTP id p22so27118930edu.11 for ; Wed, 16 Dec 2020 19:34:38 -0800 (PST) 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=OBXaO0dkIlNUOgosgWe9CaW+pideR+RDrJ1tT4OLApQ=; b=yTkGh9uIcGkWJJYC+ZRkYKur/0648G3M/GgwGK/LCWuZUpMUPWTR4LZqgydmXsoPtO 7boiV9+SQ00yNJohTpiTXCW5i7OPa+RyYyOPGYloScjXhzTu5q0V4lhvjXnUbqgmI7Ot i0xmYtewnQ3V9XPaE4UQBgLAM9XBR7TcCNdqz6h5vwYoOMuFgoH5xg7cxSSxNf3il8pY RQD2j9xrtUQF+90JXInYWClSwdTWzTjlCXlQS779YOjqOYiCElSJYEqOS0mRyizI0jnK DPWW7vaeCqsaJFyN/2M/79f0tkzgTafpIxKiWp6woc8KfxrkL0DgmCSe6AiSn0uE4zvh 7fvw== 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=OBXaO0dkIlNUOgosgWe9CaW+pideR+RDrJ1tT4OLApQ=; b=hXKRlTtuE4sE1uKBqh6v9zHXNLTpR4fZ7qD6VaAj14Y0AMBsqfe3McPmK61PdtN32W 19sNzI5JCKxhlVPUQA75UHLoKRELpn8V3FXJ3a3iXzO1pCBUlswEq23ZYxbHyMRnVjRr 3XLSLuJ23tsmWl4f2gxENF5T0klUkgvnHnTDrrQiCEsxU2EKfrjy04LTZoEmo5EyK+/I /6zmXuGebnVGOoSTkxPy8RSmP+5DnHuXuM44WRS/FSV4tkh6VBEOaVWsmSLkQe8+CMqO GoY1agJUMqTrwuFPbDJ+NOxr/Xf0SYrGWHr0gnIoChJIDhYSoMrdswPsBTLB11MPZ4+I dI+A== X-Gm-Message-State: AOAM530Xf4WK5Ve137vk6EysfUCHlLBqL48D6qzq7D+S+PkMDAFfQt4v w/bGZ6f0BdlV1r+LsZO2pR9UALn0BjI94Q== X-Google-Smtp-Source: ABdhPJzxX+z3Tu1sA4KkjbodlwaeSYr+2WhVQv+8WrjIjH3hMIOV0SbXSuT3n34iH9syIjsc3VLRqg== X-Received: by 2002:aa7:d916:: with SMTP id a22mr4244097edr.122.1608176076998; Wed, 16 Dec 2020 19:34:36 -0800 (PST) Received: from localhost.localdomain (62-46-254-11.adsl.highway.telekom.at. [62.46.254.11]) by smtp.gmail.com with ESMTPSA id b19sm22304149edx.47.2020.12.16.19.34.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 19:34:36 -0800 (PST) Message-ID: Subject: Re: Very large table: Partition it or not? From: Laurenz Albe To: Jack Orenstein , pgsql-general@postgresql.org Date: Thu, 17 Dec 2020 04:34:35 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 2020-12-16 at 14:44 -0500, Jack Orenstein wrote: > What are the pros and cons of partitioning the table? Pro: - it bebomes easier to get rid of old data - autovacuum is more fun with several smaller tables - a few select queries might become faster Con: - administrative overhead (creating and dropping partitions) - most queries become slightly slower > Without partitioning, are we liable to run into trouble as this table keeps growing? That is hard to answer. If it works fine with 5*10^9 rows, it might also work fine with more data. The deciding factor might be getting rid of old data. That can be quite painful with a single large table, but it might be trivial with partitioning. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com