0

The postgres documentation about WAL_LEVEL states:

In logical level, the same information is logged as with replica, plus information needed to extract logical change sets from the WAL. Using a level of logical will increase the WAL volume, particularly if many tables are configured for REPLICA IDENTITY FULL and many UPDATE and DELETE statements are executed.

Two questions please:

(1) Does that mean that the amount of additional WAL that accrues when using logical when compared to replica is very little (negligible) as long as no REPLICA IDENTITY FULL is used? In other words: As long as one does not use REPLICA IDENTITY FULL with (many) updates and deletes on those tables, the additional WAL amount from logical vs replica is negligible?

(2) If wal_level is set to logical and NO logical replication is used at all (only replica), is the additional WAL amount then negligible for sure?

1 Answer 1

1

The amount of WAL that is logged when you set wal_level to logical is independent of whether logical replication is used or not, which answers your second question.

Concerning the first question, you understand the mechanism properly. If writing the replica identity to WAL is negligible overhead or not depends on your definition of "negligible". If you have a table with two bigint columns, one of which is the primary key, the additional bigint written to WAL is probably not negligible. With wider tables, the difference will be less noticeable.

1
  • TYVM for the great explanation
    – Peter
    Commented Jul 10 at 10:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.