Skip to content

MvREINDEX#


Recreates all open index files for NAMEed database alias or the primary database if NAME is omitted.

Syntax
<MvREINDEX NAME = "string: {  expression } | literal"> 

Use <MvREINDEX> to incorporate all changes made to the database into the open index file(s), if they were not open when the database was updated.

In a well-constructed application this should not be necessary if the indexes were opened when the database was opened. It could be incorporated into a periodically run maintenance routine, or if a corrupted index file was detected.

Attributes#

Attribute Description
NAME Optional Database alias. When a database is opened with MvOPEN, it is referenced in all other database commands by the alias. If omitted, the index is recreated for the primary database. The database and indexes must be open.

Example#

With the employees database and all its indexes opened, <MvREINDEX> will re-create all the index files.

<MvREINDEX NAME="employees"> 

Because <MvREINDEX> can be quite resource-intensive for large databases, and does not automatically lock the database and index files that it uses, it could be used off-line, with Miva Merchant Mia. You can then re-install your database on your server. If you do re-create the index on-line, you should use <MvLOCKFILE> to request a lock on the database and index files while <MvREINDEX> is executing.