4D v16.3

PAUSE INDEXES

Home

 
4D v16.3
PAUSE INDEXES

PAUSE INDEXES 


 

PAUSE INDEXES ( aTable ) 
Parameter Type   Description
aTable  Table in Table for which to pause indexes

The PAUSE INDEXES command temporarily disables all the indexes of aTable, except for the index of the primary key.

The indexes are not physically deleted from the data (.4DIndx file) or the structure of the database (_USER_INDEXES, see System Tables), but they are rendered invalid and are thus no longer updated. When indexes are disabled, all the operations performed on aTable (queries, sorts, record additions, modifications and deletions) no longer use the indexes.

This command is mainly useful when you are importing or modifying large amounts of data in tables that have several indexes. Since 4D must update the indexes each time a record is validated, the operation could take a considerable amount of time. Disabling the indexes beforehand can significantly speed up the operation. 

To resume the indexes after the operation is over, you can just call the RESUME INDEXES command for aTable

Note: You can obtain a similar result by using the CREATE INDEX and DELETE INDEX commands, but with notable differences:

If you call the PAUSE INDEXES command for a table and then quit the database without having called the RESUME INDEXES command for this table, all this table’s indexes are automatically rebuilt when the database is restarted.

Note: This command cannot be executed from a 4D remote.

Example  

Example of method for importing large amounts of data:

 PAUSE INDEXES([Articles])
 IMPORT DATA("HugeImport.txt") //Importing
 RESUME INDEXES([Articles])



See also 

DELETE INDEX
RESUME INDEXES

 
PROPERTIES 

Product: 4D
Theme: Structure Access
Number: 1293

This command can be run in preemptive processesDifferent in remote mode

 
HISTORY 

Created: 4D v14

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)