Glossary — in plain language

Apply lag

Also called: replay lag

In plain English

Apply lag (replay lag) is the gap between WAL a standby has received and WAL it has actually applied. On a healthy replica it’s tiny; on a delayed standby it’s held large on purpose. You can see it as the distance between pg_last_wal_receive_lsn() and pg_last_wal_replay_lsn().

Why it matters

Apply lag is distinct from receive lag: a standby can be fully caught up on receiving WAL (no data-loss risk) yet far behind on applying it. Read queries see the replayed state, so apply lag is what determines how stale a replica’s reads are.

Was this helpful?

← Browse the full glossary