gin_fuzzy_search_limit
Read PG 18 manual ↗Soft upper limit of the size of the set returned by GIN index scans.
- Type
- integer
- Context
- user
- Measured default
- 0
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
Soft upper limit of the size of the set returned by GIN index scans. For more information see Section 65.4.5.
Measured default history
| Version interval | Default |
|---|---|
| 9.0 – 19 | 0 |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
gin_fuzzy_search_limit sets the maximum allowed result for exact search by GIN. 0 means no limit. A positive limit makes broad GIN searches return a randomly chosen subset of matches, trading completeness for bounded work; zero preserves exact results.
gin_fuzzy_search_limit is a USER-context setting. An authorized role can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.
GIN behavior also depends on per-index storage parameters, work or maintenance memory, autovacuum, and the shape of indexed values and predicates.
Operational considerations
Changing gin_fuzzy_search_limit in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.
Applying a cluster-wide GIN value to fix one exceptional index instead of using its storage parameters.
Ignoring cleanup latency, I/O bursts, autovacuum interaction, or result completeness while tuning.
Enabling a positive limit without telling callers that exact searches may return an incomplete random subset.
Workload guidance
OLAP: For batch loads or broad searches, test gin_fuzzy_search_limit against ingestion latency, cleanup spikes, result completeness, and maintenance windows.
OLTP: Change gin_fuzzy_search_limit only after measuring the affected GIN maintenance or search path. Prefer an index-level override when one index, rather than the whole cluster, is exceptional.
SMALL: Do not raise gin_fuzzy_search_limit merely because the default is reached; bound memory and I/O bursts, and keep exact-query semantics unless approximation is explicitly acceptable.
Version history 12
- PG 17 → 18changed
- PG 16 → 17changed
- PG 14 → 15changed
- PG 13 → 14changed
- PG 10 → 11changed
- PG 9.6 → 10changed
- PG 9.5 → 9.6changed
- PG 9.4 → 9.5changed
- PG 9.3 → 9.4changed
- PG 9.2 → 9.3changed
- PG 9.1 → 9.2changed
- PG 9.0 → 9.1changed
Related entries
Further reading
Definition snapshot: english-manuals:076fef871728979d45bde6acf68… · English manual source