Class Definition Reference
Describes the structure of an index definition.
An index is a structure maintained by a persistent class that is intended to be used to optimize queries and other functions. These indices are automatically maintained whenever INSERT, UPDATE, or DELETE SQL-based operations are carried out against the database; likewise for object-based actions. The SQL Query Processor makes use of available indices when preparing and executing SQL queries.
You can add index definitions to persistent classes. They are not meaningful in other kinds of classes.
An index definition has the following structure:
Index name On property_expression_list [ keyword_list ];
(optional) is intended for display in the Class Reference. The description is blank by default. See Creating Class Documentation
in Defining and Using Classes
(required) is the name of the index. This must be a valid identifier
that is unique within this class or table.
This name is used for database administrative purposes (reporting, index building, dropping indices, and so on).
property_expression_list (required) specifies the property or properties on which the index is based and may also include a collation specification for each property. This option is either a single property expression or a comma-separated list of property expressions, enclosed in parentheses.
A given property expression consists of:
The name of the property to be indexed.
An optional (ELEMENTS) or (KEYS) expression, which provides a means of indexing on collection subvalues.
An optional collation expression.
keyword_list (optional) is a comma-separated list of keywords that further define the index.
If this list is omitted, also omit the square brackets.
For example, the following class definition defines two properties and an index based on each of them:
Class MyApp.Student Extends %Persistent
Property Name As %String;
Property GPA As %Double;
Index NameIDX On Name;
Index GPAIDX On GPA;
Content Date/Time: 2019-08-20 05:45:45