Configuration parameter

synchronize_seqscans — PostgreSQL configuration parameter

Category Version and Platform Compatibility Default on

This allows sequential scans of large tables to synchronize with each other, so that concurrent scans read the same block at about the same time and hence share the I/O workload.

At a glance

Property Value
Parameter synchronize_seqscans
Category Version and Platform Compatibility
Default on
Value type boolean (on/off)
Change scope Per-session (SET)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

This allows sequential scans of large tables to synchronize with each other, so that concurrent scans read the same block at about the same time and hence share the I/O workload. When this is enabled, a scan might start in the middle of the table and then “wrap around” the end to cover all rows, so as to synchronize with the activity of scans already in progress. This can result in unpredictable changes in the row ordering returned by queries that have no ORDER BY clause. Setting this parameter to off ensures the pre-8.3 behavior in which a sequential scan always starts from the beginning of the table. The default is on.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW synchronize_seqscans; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'synchronize_seqscans';.

Tuning guidance

This controls backward-compatibility behaviour, not performance. Keep it at the modern default unless a specific legacy application depends on the older behaviour; turning compatibility flags on to paper over application bugs stores up problems for a future upgrade. Treat any non-default value as technical debt to remove.

Reference

PostgreSQL documentation — synchronize_seqscans.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters