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 DEFAULT expressions.

  • The INSERT query has a RETURNING clause.

  • The INSERT query contains volatile functions.

  • The number of rows to be inserted is less than the threshold, i.e., 5120 for regular tables and 10240 for unlogged tables.