Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Databases - Practical PostgreSQL
Previous Page Home Next Page

REINDEX

Name

REINDEX -- Rebuilds indices on tables.

Synopsis

REINDEX { TABLE | DATABASE | INDEX } 
name
 [ FORCE ]

Parameters

TABLE | DATABASE | INDEX

The type of database object to be re-indexed.

name

The name of the database object you wish to re-index.

FORCE

The FORCE keyword forces the rebuilding of all specified indices. If this parameter is not given, the REINDEX command will rebuild only invalidated indices.

Results

REINDEX

The message returned when a target object is successfully reindexed.

Description

Use the REINDEX command to rebuild any indices that have become corrupt. This is especially useful if system indices become corrupted. To fix them, shutdown postmaster and start it using the -o "-O -P" command-line parameter. This opens a standalone server that allows for re-indexing of system indices. Run the REINDEX DATABASE command once you are at the psql prompt.

Examples

The following example rebuilds all indices on the books table, within the booktown database:

booktown=# 
REINDEX TABLE books;

REINDEX
Databases - Practical PostgreSQL
Previous Page Home Next Page

 
 
  Published under the terms of the Open Publication License Design by Interspire