34.2. Append-Optimized Tables #
When append_optimized is enabled, incoming rows for AOTs first go to a special buffer. Once the buffer is full, Postgres Pro inserts these rows in a single operation whenever possible and generates a single WAL record for the rows. This reduces the time spent searching for buffers in shared memory and generates fewer WAL records.
A table with append_optimized enabled behaves like a regular table and supports all standard operations. An exclusive lock is required only when enabling or disabling the parameter on an existing table using ALTER TABLE ... SET.
34.2.1. Limitations of Append-Optimized Tables #
Optimized append-only insertion is not used in the following cases:
The table is a foreign table.
The table is a temporary table.
The table has row-level triggers.
The table has volatile
DEFAULTexpressions.The
INSERTquery has aRETURNINGclause.The
INSERTquery contains volatile functions.The number of rows to be inserted is less than the threshold, i.e.,
5120for regular tables and10240for unlogged tables.