SyncScan wait event (LWLock) — PostgreSQL

PostgreSQL LWLock wait event SyncScan: Waiting to select the starting location of a synchronized table scan.

Summary

SyncScan is a PostgreSQL LWLock wait event. The official server documentation describes it as: “Waiting to select the starting location of a synchronized table scan.” (verbatim from PostgreSQL’s wait_event_names.txt catalog).

Classification

  • wait_event: SyncScan
  • wait_event_type: LWLock
  • Reported in: pg_stat_activity

What the LWLock class indicates

(Paraphrased explanation.) The process is waiting for a lightweight lock that protects a particular shared-memory data structure. Contention here usually reflects an internal hot spot.

How to observe it

(Illustrative query — not from the catalog.) You can see which sessions are currently reporting this wait event in the cumulative statistics view:

SELECT pid, state, wait_event_type, wait_event, query
FROM pg_stat_activity
WHERE wait_event_type = 'LWLock'
  AND wait_event = 'SyncScan';

Version applicability

Confirmed present in PostgreSQL major version(s): 12, 13, 14, 15, 16, 17, 18, 19 (verified against each release’s server source).

This is a long-standing wait event: it is present at least as far back as PostgreSQL 12 (the oldest release checked here) and very likely predates it.

The machine-readable wait_event_names.txt catalog exists from PostgreSQL 17 onward; presence in PostgreSQL 12–16 was verified directly from the wait-event, lock, and lightweight-lock definitions in those releases’ source code.

References

  • PostgreSQL documentation — Wait Events
  • PostgreSQL source — src/backend/utils/activity/wait_event_names.txt