Linux command
reindexdb 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Reindex database
reindexdb [database_name]
Reindex specific table
reindexdb -t [table_name] [database_name]
Reindex specific index
reindexdb -i [index_name] [database_name]
Reindex all databases
reindexdb -a
Reindex system catalogs
reindexdb -s [database_name]
Connect as user
reindexdb -U [username] [database_name]
Concurrently reindex
reindexdb --concurrently [database_name]
说明
reindexdb rebuilds PostgreSQL indexes. It's a wrapper around SQL REINDEX. Full database reindex rebuilds all indexes. Fixes corruption and reduces bloat. Table-specific reindex targets problem areas. Faster than full database reindex. Concurrent mode allows operations during reindex. Indexes remain usable but reindex is slower. Parallel jobs speed up multi-table reindex. Each table indexed separately.
参数
- -t, --table _NAME_
- Reindex specific table.
- -i, --index _NAME_
- Reindex specific index.
- -a, --all
- All databases.
- -s, --system
- System catalogs only.
- --concurrently
- Concurrent reindex.
- -U, --username _USER_
- Connect as user.
- -h, --host _HOST_
- Database server.
- -p, --port _PORT_
- Server port.
- -j, --jobs _N_
- Parallel jobs.
FAQ
What is the reindexdb command used for?
reindexdb rebuilds PostgreSQL indexes. It's a wrapper around SQL REINDEX. Full database reindex rebuilds all indexes. Fixes corruption and reduces bloat. Table-specific reindex targets problem areas. Faster than full database reindex. Concurrent mode allows operations during reindex. Indexes remain usable but reindex is slower. Parallel jobs speed up multi-table reindex. Each table indexed separately.
How do I run a basic reindexdb example?
Run `reindexdb [database_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -t, --table _NAME_ do in reindexdb?
Reindex specific table.