Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
Appendix K. PostgreSQL Limits
Prev UpPart VIII. AppendixesHome Next

Appendix K. PostgreSQL Limits

Table K.1 describes various hard limits ofPostgreSQL. However, practical limits, such as performance limitations or available disk space may apply before absolute hard limits are reached.

Table K.1. PostgreSQL Limitations

ItemUpper LimitComment
database sizeunlimited 
number of databases4,294,950,911 
relations per database1,431,650,303 
relation size32 TBwith the defaultBLCKSZ of 8192 bytes
rows per tablelimited by the number of tuples that can fit onto 4,294,967,295 pages 
columns per table1,600further limited by tuple size fitting on a single page; see note below
columns in a result set1,664 
field size1 GB 
indexes per tableunlimitedconstrained by maximum relations per database
columns per index32can be increased by recompilingPostgreSQL
partition keys32can be increased by recompilingPostgreSQL
identifier length63 bytescan be increased by recompilingPostgreSQL
function arguments100can be increased by recompilingPostgreSQL
query parameters65,535 

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 1,600int columns would consume 6400 bytes and could be stored in a heap page, but a tuple of 1,600bigint columns would consume 12800 bytes and would therefore not fit inside a heap page. Variable-length fields of types such astext,varchar, andchar 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.

Each table can store a theoretical maximum of 2^32 out-of-line values; seeSection 65.2 for a detailed discussion of out-of-line storage. This limit arises from the use of a 32-bit OID to identify each such value. The practical limit is significantly less than the theoretical limit, because as the OID space fills up, finding an OID that is still free can become expensive, in turn slowing down INSERT/UPDATE statements. Typically, this is only an issue for tables containing many terabytes of data; partitioning is a possible workaround.


Prev Up Next
J.6. Style Guide Home Appendix L. Acronyms
pdfepub
Go to PostgreSQL 17
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp