This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20.6
PAUSE INDEXES
|
PAUSE INDEXES ( aTable ) | ||||||||
Parameter | Type | Description | ||||||
aTable | Table |
![]() |
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 of method for importing large amounts of data:
PAUSE INDEXES([Articles])
IMPORT DATA("HugeImport.txt") //Importing
RESUME INDEXES([Articles])
Product: 4D
Theme: Structure Access
Number:
1293
Created: 4D v14
4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)