Files
cheatsheet-tldr/tldr/reindexdb
2025-10-09 00:19:00 +00:00

42 lines
1.0 KiB
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# reindexdb
> Rebuild indexes in a PostgreSQL database.
> More information: <https://www.postgresql.org/docs/current/app-reindexdb.html>.
- Reindex a specific database:
`reindexdb {{database_name}}`
- Reindex a specific database using connection options:
`reindexdb {{database_name}} {{[-h|--host]}} {{hostname}} {{[-p|--port]}} {{port}} {{[-U|--username]}} {{username}}`
- Reindex all databases:
`reindexdb {{[-a|--all]}}`
- Reindex a specific table in a database:
`reindexdb {{database_name}} {{[-t|--table]}} {{table_name}}`
- Reindex a specific index in a database:
`reindexdb {{database_name}} {{[-i|--index]}} {{index_name}}`
- Reindex a specific schema in a database:
`reindexdb {{database_name}} {{[-S|--schema]}} {{schema_name}}`
- Reindex with verbose output:
`reindexdb {{database_name}} {{[-v|--verbose]}}`
- Reindex a database using multiple parallel jobs:
`reindexdb {{database_name}} {{[-j|--jobs]}} {{number_of_jobs}}`