autoreindex
autoreindex · Shared-preload background-worker extension that scans for bloated indexes and performs concurrent reindexing work in the background.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100412 | autoreindex | autoreindex | 1.0 | ADMIN | Unknown | C |
Usage
Sources:
autoreindex is an unfinished background-worker prototype that was intended to detect bloated indexes and rebuild them. The checked upstream revision does not actually run a reindex command: it finds and logs candidates, then executes a test block containing a sleep. Do not use it as an automatic index-maintenance system.
Core Workflow
This is a headless module, not a SQL extension. Add autoreindex to shared_preload_libraries and restart PostgreSQL only in an isolated test instance:
The controller visits connectable databases and starts workers. The current worker excludes primary and system indexes, logs candidate rows, and then sleeps; there is no completed CREATE INDEX CONCURRENTLY or equivalent maintenance path.
Important Objects
autoreindex.diagnosticscontrols diagnostic logging.autoreindex.hide_context_log_messagescontrols context-message suppression.autoreindex.max_workersandautoreindex.max_workers_per_databaselimit background workers.autoreindex.naptimecontrols the worker interval.
Operational Notes
Because the library must be preloaded, installation changes postmaster startup behavior even though it does not provide useful reindexing. The prototype is from 2016, has a control file but no extension SQL script, and contains hard-coded test behavior. Keep it out of production and use maintained PostgreSQL maintenance tooling for index-bloat policy and concurrent rebuilds.