Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bzTn2-0000cB-RE for pgsql-admin@arkaria.postgresql.org; Wed, 26 Oct 2016 19:23:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bzTn2-0000hl-EJ for pgsql-admin@arkaria.postgresql.org; Wed, 26 Oct 2016 19:23:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bzTn1-0000hX-OF for pgsql-admin@postgresql.org; Wed, 26 Oct 2016 19:23:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bzTmz-0006EK-BT for pgsql-admin@postgresql.org; Wed, 26 Oct 2016 19:23:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u9QJMvAK024096; Wed, 26 Oct 2016 15:22:57 -0400 From: Tom Lane To: Natalie Wenz cc: pgsql-admin Subject: Re: pg_toast oid limits In-reply-to: References: Comments: In-reply-to Natalie Wenz message dated "Wed, 26 Oct 2016 13:58:29 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24093.1477509777.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 26 Oct 2016 15:22:57 -0400 Message-ID: <24095.1477509777@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Natalie Wenz writes: > I am seeing some performance issues that I'm trying to track down on a la= rge database. One of the things I'm beginning to suspect is a particularly = large table with many columns, about 200 of which (type text) contain large= chunks of data. Now, for a given row, maybe 10-30 of those columns contain= data, so not all 200 for each row, but the data can still be pretty sizabl= e. There are currently around 750 million records in this table (and is abo= ut 22TB in size). I was trying to learn more about toast, and I see some re= ferences in the wiki and the hackers list to performance issues when you ap= proach the 4 billion oids for a single table (which, I gather, are used whe= n the data is toasted). Given my rudimentary understanding of how the whole= toast thing works, I was wondering if there is a way to see how many oids = are used for a table, or another way to know if we're running into toast li= mits for a single table. You could do select reltoastrelid::regclass from pg_class where relname =3D 'problem_tab= le'; which will give you something like reltoastrelid=20=20=20=20=20=20 ------------------------- pg_toast.pg_toast_78004 and then poke into the contents of that table. Probably select count(distinct chunk_id) from pg_toast.pg_toast_78004; would answer your immediate question. regards, tom lane --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin