1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix K. PostgreSQL Limits</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="docguide-style.html" title="J.5. Style Guide" /><link rel="next" href="acronyms.html" title="Appendix L. Acronyms" /></head><body id="docContent" class="container-fluid col-10"><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">Appendix K. <span xmlns="http://www.w3.org/1999/xhtml" class="productname">PostgreSQL</span> Limits</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="docguide-style.html" title="J.5. Style Guide">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="appendixes.html" title="Part VIII. Appendixes">Up</a></td><th width="60%" align="center">Part VIII. Appendixes</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 13.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="acronyms.html" title="Appendix L. Acronyms">Next</a></td></tr></table><hr></hr></div><div class="appendix" id="LIMITS"><div class="titlepage"><div><div><h2 class="title">Appendix K. <span class="productname">PostgreSQL</span> Limits</h2></div></div></div><p>
<a class="xref" href="limits.html#LIMITS-TABLE" title="Table K.1. PostgreSQL Limitations">Table K.1</a> describes various hard limits of
<span class="productname">PostgreSQL</span>. However, practical limits, such as
performance limitations or available disk space may apply before absolute
hard limits are reached.
</p><div class="table" id="LIMITS-TABLE"><p class="title"><strong>Table K.1. <span class="productname">PostgreSQL</span> Limitations</strong></p><div class="table-contents"><table class="table" summary="PostgreSQL Limitations" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Item</th><th>Upper Limit</th><th>Comment</th></tr></thead><tbody><tr><td>database size</td><td>unlimited</td><td> </td></tr><tr><td>number of databases</td><td>4,294,950,911</td><td> </td></tr><tr><td>relations per database</td><td>1,431,650,303</td><td> </td></tr><tr><td>relation size</td><td>32 TB</td><td>with the default <code class="symbol">BLCKSZ</code> of 8192 bytes</td></tr><tr><td>rows per table</td><td>limited by the number of tuples that can fit onto 4,294,967,295 pages</td><td> </td></tr><tr><td>columns per table</td><td>1600</td><td>further limited by tuple size fitting on a single page; see note
below</td></tr><tr><td>field size</td><td>1 GB</td><td> </td></tr><tr><td>identifier length</td><td>63 bytes</td><td>can be increased by recompiling <span class="productname">PostgreSQL</span></td></tr><tr><td>indexes per table</td><td>unlimited</td><td>constrained by maximum relations per database</td></tr><tr><td>columns per index</td><td>32</td><td>can be increased by recompiling <span class="productname">PostgreSQL</span></td></tr><tr><td>partition keys</td><td>32</td><td>can be increased by recompiling <span class="productname">PostgreSQL</span></td></tr></tbody></table></div></div><br class="table-break" /><p>
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 <code class="type">int</code> columns
would consume 6400 bytes and could be stored in a heap page, but a tuple of
1600 <code class="type">bigint</code> columns would consume 12800 bytes and would
therefore not fit inside a heap page.
Variable-length fields of
types such as <code class="type">text</code>, <code class="type">varchar</code>, and <code class="type">char</code>
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.
</p><p>
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.
</p></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="docguide-style.html" title="J.5. Style Guide">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendixes.html" title="Part VIII. Appendixes">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="acronyms.html" title="Appendix L. Acronyms">Next</a></td></tr><tr><td width="40%" align="left" valign="top">J.5. Style Guide </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 13.4 Documentation">Home</a></td><td width="40%" align="right" valign="top"> Appendix L. Acronyms</td></tr></table></div></body></html>
|