InterSystems IRIS Data Platform 2019.2  /  Class Definition Reference

Class Definition Reference
Index Definitions
Previous section           Next section
InterSystems: The power behind what matters   

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:
/// description 
Index name On property_expression_list [ keyword_list ];
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;

See Also

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-08-20 05:45:45