Re: Fwd: [GENERAL] 4B row limit for CLOB tables

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Álvaro Hernández Tortosa <aht(at)8Kdata(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fwd: [GENERAL] 4B row limit for CLOB tables
Date: 2015-04-23 16:11:57
Message-ID: 20150423161157.GF31856@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Sun, Feb 1, 2015 at 03:54:03PM +0100, Álvaro Hernández Tortosa wrote:
>
> On 31/01/15 14:55, Roger Pack wrote:
> >[...]
> >
> >Now, the reality is that GetNewOidWithIndex() is going to keep
> >incrementing the global OID counter until it finds an OID that isn't in
> >the toast table. That means that if you actually get anywhere close to
> >using 4B OIDs you're going to become extremely unhappy with the
> >performance of toasting new data.
> >OK so "system stability" doesn't degrade per se when it wraps [since
> >they all use that GetNewOid method or similar [?] good to know.
> >
> >So basically when it gets near 4B TOAST'ed rows it may have to wrap that
> >counter and search for "unused" number, and for each number it's
> >querying the TOAST table to see if it's already used, degrading
> >performance.
>
>
> The problem here is that performance degrades exponentially, or
> worse. Speaking here from experience, we already tested this for a
> very similar case (table creation, where two oids are consumed from
> a global sequence when inserting to pg_class). Have a look at
> http://www.slideshare.net/nosys/billion-tables-project-nycpug-2013,
> slides 43-45. We tested there this scenario and shown that table
> creations per second dropped from 10K to a few per second and then
> to a few per day. In the graphs you can't even realize there were
> more tables been created. At around 8K tables from the theoretical
> limit of 4B oids consumed, the process basically stopped (doing more
> insertions).

I had a look at our FAQ about Postgres limitations and I don't see
anything that needs changing:

https://wiki.postgresql.org/wiki/FAQ#What_is_the_maximum_size_for_a_row.2C_a_table.2C_and_a_database.3F

Maximum size for a database? unlimited (32 TB databases exist)
Maximum size for a table? 32 TB
Maximum size for a row? 400 GB
Maximum size for a field? 1 GB
Maximum number of rows in a table? unlimited
Maximum number of columns in a table? 250-1600 depending on column types
Maximum number of indexes on a table? unlimited

We don't report the maximum number of tables per database, or the
maximum number of TOAST values. Agreed?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cory Tucker 2015-04-23 17:09:20 Moving Specific Data Across Schemas Including FKs
Previous Message Jim Nasby 2015-04-23 14:38:15 Re: R: DB on mSATA SSD

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2015-04-23 16:17:28 Re: anole - test case sha2 fails on all branches
Previous Message Peter Geoghegan 2015-04-23 16:09:21 Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0