Parameter · Query Tuning / Planner Method Configuration
enable_tidscan
Enables the planner's use of TID scan plans.
- Default:
on - Type: bool
- Applies: Session (any user)
In plain words
Every row version has a physical address called the ctid (page number, slot number). A query with WHERE ctid = '(1,1)' can jump straight to it. This switch turns that shortcut off; it is rarely touched.
For DBAs and operators
A Tid Scan reads only the page named in the TID condition; a Tid Range Scan (PostgreSQL 14+) handles ctid >= '(1000,0)' AND ctid < '(2000,0)' and reads just that block range. Range scans are useful for chunked batch jobs, such as deleting or updating a big table piece by piece without an index.
Measured on 18.6: WHERE ctid = '(1,1)': Tid Scan, cost 4.01. With enable_tidscan = off: Seq Scan with a filter, cost 4,773. In this version the switch covers both TID scans and TID range scans.
A ctid is not a stable row identifier: UPDATE creates a new version with a new ctid, and VACUUM FULL or CLUSTER rewrites them all. Use it only within one transaction or for maintenance tasks, never as an application key. WHERE CURRENT OF cursor also uses a TID scan internally.
How to change it
Any user can change it for their session with SET.