From 68120427f4902c136066d10ac9da93355877e156 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 29 Nov 2018 13:58:28 +0100 Subject: [PATCH] doc: Add appendix detailing some limits of PostgreSQL This used to be on the web site but was removed. The documentation is a better place for it anyway. Author: David Rowley Reviewed-by: John Naylor Discussion: https://www.postgresql.org/message-id/flat/CAKJS1f_dKdejdKB94nKZC9S5NzB-UZRcAKkE84e=JEEecDuotg@mail.gmail.com/ --- doc/src/sgml/filelist.sgml | 1 + doc/src/sgml/limits.sgml | 120 +++++++++++++++++++++++++++++++++++++ doc/src/sgml/postgres.sgml | 1 + 3 files changed, 122 insertions(+) create mode 100644 doc/src/sgml/limits.sgml diff --git a/doc/src/sgml/filelist.sgml b/doc/src/sgml/filelist.sgml index 0a10df6402..5dfdf54815 100644 --- a/doc/src/sgml/filelist.sgml +++ b/doc/src/sgml/filelist.sgml @@ -183,6 +183,7 @@ + diff --git a/doc/src/sgml/limits.sgml b/doc/src/sgml/limits.sgml new file mode 100644 index 0000000000..ab85413fa6 --- /dev/null +++ b/doc/src/sgml/limits.sgml @@ -0,0 +1,120 @@ + + + + <productname>PostgreSQL</productname> Limits + + + describes various hard limits of + PostgreSQL. However, practical limits, such as + performance limitations or available disk space may apply before absolute + hard limits are reached. + + + + <productname>PostgreSQL</productname> limitations + + + + Item + Upper Limit + Comment + + + + + + database size + unlimited + + + + + number of databases + + 4,294,950,911 + + + + + relations per database + + 1,431,650,303 + + + + + relation size + 32 TB + with the default BLCKSZ of 8192 bytes + + + + rows per table + limited by the number of tuples that can fit onto 4,294,967,295 pages + + + + + columns per table + 1600 + further limited by tuple size fitting on a single page; see note + below + + + + field size + 1 GB + + + + + identifier length + 63 bytes + can be increased by recompiling PostgreSQL + + + + indexes per table + unlimited + constrained by maximum relations per database + + + + columns per index + 32 + can be increased by recompiling PostgreSQL + + + + partition keys + 32 + can be increased by recompiling PostgreSQL + + + +
+ + + The maximum number of columns for a table is further reduced as the tuple + being stored must fit in a single 8192-byte heap page. For example, + excluding the tuple header, a tuple made up of 1600 int columns + would consume 6400 bytes and could be stored in a heap page, but a tuple of + 1600 bigint columns would consume 12800 bytes and would + therefore not fit inside a heap page. + Variable-length fields of + types such as text, varchar, and char + can have their values stored out of line in the table's TOAST table when the + values are large enough to require it. Only an 18-byte pointer must remain + inside the tuple in the table's heap. For shorter length variable-length + fields, either a 4-byte or 1-byte field header is used and the value is + stored inside the heap tuple. + + + + Columns that have been dropped from the table also contribute to the maximum + column limit. Moreover, although the dropped column values for newly + created tuples are internally marked as null in the tuple's null bitmap, the + null bitmap also occupies space. + +
diff --git a/doc/src/sgml/postgres.sgml b/doc/src/sgml/postgres.sgml index 142799316a..96d196d229 100644 --- a/doc/src/sgml/postgres.sgml +++ b/doc/src/sgml/postgres.sgml @@ -275,6 +275,7 @@ &external-projects; &sourcerepo; &docguide; + &limits; &acronyms; -- 2.40.0