pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ravi Krishna <sravikrishna@comcast.net>
To: Jack Orenstein <jao@geophile.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Very large table: Partition it or not?
Date: Wed, 16 Dec 2020 17:41:05 -0500
Message-ID: <97B97F37-D49B-430F-9DFE-17E064788786@comcast.net> (raw)
In-Reply-To: <CAGNxcaveCA0wPux6gko2yX=e_N0Y0AUkbBGAjZOt6g7txgC3aQ@mail.gmail.com>
References: <CAGNxcaveCA0wPux6gko2yX=e_N0Y0AUkbBGAjZOt6g7txgC3aQ@mail.gmail.com>

> 
> 
> I have a table in an analytics database (Postgres 12.3), that gathers data continuously. It is at 5B rows, with an average row size of 250 bytes. The table has five indexes, on bigint and varchar columns, all with keys of one or two columns.
> 
> There are currently frequent updates and deletions, but the net change in the number of rows is continuously positive. We are rearchitecting the application to avoid the updates and deletes. I.e., the table will soon be append-only, (so vacuuming will be needed only to avoid transaction id wraparound).
> 
> I know that the maximum table size is 32TB, which allows for 128B rows. Based on this calculation, and the expected growth rate (2B/year currently), we should be good for quite a while.
> 
> What are the pros and cons of partitioning the table? Without partitioning, are we liable to run into trouble as this table keeps growing? I do realize that some query times will grow with table size, and that partitioning, combined with parallel query execution can address that problem. I'm more wondering about problems in maintaining tables and indexes once we have 10B, 20B, ... rows.
> 
> 

Does the table has a primary key/unique constraint which can not be part of the partitioning key.  Then you have a serious issue in converting this
table into a partitioned one. Unlike Oracle or Db2, PG still does not have a concept of global index on a partitioned table.






view thread (3+ messages)  latest in thread

Message-ID: <97B97F37-D49B-430F-9DFE-17E064788786@comcast.net>
Permalink:  ../97B97F37-D49B-430F-9DFE-17E064788786@comcast.net/
Also on:    postgresql.org/message-id/97B97F37-D49B-430F-9DFE-17E064788786@comcast.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: sravikrishna@comcast.net, jao@geophile.com
  Subject: Re: Very large table: Partition it or not?
  In-Reply-To: <97B97F37-D49B-430F-9DFE-17E064788786@comcast.net>
  References: <CAGNxcaveCA0wPux6gko2yX=e_N0Y0AUkbBGAjZOt6g7txgC3aQ@mail.gmail.com> <97B97F37-D49B-430F-9DFE-17E064788786@comcast.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox