Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bzWp4-0006ZU-Sm for pgsql-admin@arkaria.postgresql.org; Wed, 26 Oct 2016 22:37:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bzWp4-0000iS-Bj for pgsql-admin@arkaria.postgresql.org; Wed, 26 Oct 2016 22:37:26 +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 1bzWnO-00073B-Hg for pgsql-admin@postgresql.org; Wed, 26 Oct 2016 22:35:42 +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 1bzWnM-0001a2-2U for pgsql-admin@postgresql.org; Wed, 26 Oct 2016 22:35:41 +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 u9QMZaj6010803; Wed, 26 Oct 2016 18:35:36 -0400 From: Tom Lane To: Natalie Wenz cc: pgsql-admin , "Joshua D. Drake" , david.g.johnston@gmail.com Subject: Re: pg_toast oid limits In-reply-to: <8B647628-89BE-43FE-B538-973BF85A79A9@ebureau.com> References: <24095.1477509777@sss.pgh.pa.us> <8B647628-89BE-43FE-B538-973BF85A79A9@ebureau.com> Comments: In-reply-to Natalie Wenz message dated "Wed, 26 Oct 2016 17:12:59 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10801.1477521336.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 26 Oct 2016 18:35:36 -0400 Message-ID: <10802.1477521336@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'm a little confused about the limit. Is it 4 billion oids for the whole= database, or just per table? I keep coming back to this line, from https:/= /wiki.postgresql.org/wiki/TOAST :=20 Per table --- the problem is you need a unique 4-byte chunk_id for each toasted field value. > "If you exceed 4 billion of these rows across all tables (remember this i= s a global shared wrapping counter), then the OID counter "wraps" which mig= ht cause significant slowdown as you approach the 4B row limit." Um. That could use improvement, couldn't it. The numbers are sourced from a global counter, but as the counter wraps around it's possible for the same number to be re-used in different toast tables. You only start to see a problem when the density of already-used numbers in a particular toast table gets too high, so that the system has to spend a long time searching for the next free number. 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