REINDEX Command

Example   See Also

Rebuilds open index files.

Syntax

REINDEX [COMPACT]

Arguments

COMPACT

Converts regular single index (.idx) files to compact .idx files.

Remarks

Index files become outdated when you open a table without opening its corresponding index files and make changes to the index files' key fields. When index files become outdated, you can update them by reindexing.

REINDEX updates all index files open in the selected work area. Visual FoxPro recognizes each index file type ( compound index (.cdx) files, structural .cdx files, and single index (.idx) files) and reindexes accordingly. It updates all tags in .cdx files, and updates structural .cdx files, which automatically open with the table.

Any index files created with the UNIQUE keyword of the INDEX command or with SET UNIQUE ON retain their UNIQUE status when reindexed.

To REINDEX outdated index files, issue these commands:

USE TableName INDEX OutdatedIndexNames
REINDEX