4D v14.3CREATE INDEX |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
CREATE INDEX
CREATE INDEX
The CREATE INDEX command creates:
The index is created for the aTable table by using one or more fields designated by the fieldsArray pointer array. This array contains a single row when you want to create a simple index and two or more rows when you want to create a composite index (except in the case of a keyword index). In the case of composite indexes, the order of the fields in the array is important when the index is being built. The indexType parameter sets the type of index to be created. You can pass one of the following constants, found in the Index Type theme:
Note: A B-Tree index associated with a Text type field stores the first 1024 characters of the field (maximum). Therefore in this context, searches for strings containing more than 1024 characters will fail. In the indexName parameter, you pass the name of the index to be created. Naming the index is necessary if several different types of indexes can be associated with the same field and if you want to be able to delete them individually using the DELETE INDEX command. If the indexName index already exists, the command does nothing. The optional * parameter, when it is passed, performs indexing in asynchronous mode. In this mode, the original method continues its execution after the call from the command, regardless of whether or not the indexing is finished. If the CREATE INDEX command encounters any locked records, they will not be indexed and the command will wait for them to be unlocked. If a problem occurs during command execution (non-indexed field, attempt to create a keyword index on more than one field, etc.), an error is generated. This error can be intercepted using an error-handling method. Creation of two standard indexes on the “Last Name” and “Telephone”fields of the [Customers] table:
ARRAY POINTER(fieldPtrArr;1) Creation of a keywords index on the “Observations” field of the [Customers] table:
ARRAY POINTER(fieldPtrArr;1) Creation of a composite index on the “City” and “Zipcode” fields of the [Customers] table:
ARRAY POINTER(fieldPtrArr;2) |
PROPERTIES
Product: 4D
HISTORY
Created: 4D v11 SQL SEE ALSO
DELETE INDEX ARTICLE USAGE
4D Language Reference ( 4D v14 R3) Inherited from : CREATE INDEX ( 4D v12.4) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||