Class Reference
IRIS for UNIX 2024.1.2
|
|
Private
Storage
|
An index is a structure maintained by a persistent class that is intended to be used to optimize certain queries and other functions. objects supports three primary types of indexes - regular, bitmap and key structures. The index type is defined by two index keywords, TYPE and EXTENT. It is also possible to declare a type class for an index. This index type class is expected to implement the index type class interface as defined by this class. The classtype of the index type class is expected to be INDEX.
Functional Indexing is the feature in InterSystems IRIS Objects that allows a user to implement a class that maintains an index structure and a function that can be used by SQL to resolve certain SQL query operators. A Functional Index class must implement two interfaces. The first interface is the index filing interface, the second is the query interface used by SQL.
The Index Filing Interface consists of six methods. The three methods that implement instance filing,
index x1F on (Name, DOB, Home_City) as User.MyIndexClass [ data=(Name,BirthPlace)];
Three additional methods are included in the Index Filing Interface. They are
The Query Interface consists of at least one method that is projected to SQL as a function. Arguments of this function should be limited to the set of index properties.
When implementing a functional index class it is sometimes necessary to access the compiled class dictionary metadata. The class compiler will not have generated a specific global location for the functional index. That is the responsibility of the functional index class. When you need a global location for a functional index the convention is to use the defined global location values from the storage definition but the details of exactly what global location will be used by the index are left to the functional index class.
Functional Indexes continue with this behavior with the index filing method simply performing the work needed to place one subvalue into the index. The Objects and SQL filers will continue to determine the set of subvalues, both existing and new, and call the Functional Index interface iteratively.
When the index structure includes subvalues but there is no declaration in the index property specifications then it is entirely up to the Functional Index implementation to determine the set of subvalues and to provide the necessary subvalue iterators. The Objects and SQL filers will invoke the Functional Index filer with existing and new values as if the index is on the entire property value.
|
|
Methods | |||
---|---|---|---|
DeleteIndex | Find | InsertIndex | PurgeIndex |
SegmentFinalize | SegmentInitialize | SegmentInsert | SortBeginIndex |
SortEndIndex | UpdateIndex |
Subclasses | ||
---|---|---|
%IPM.General.SemanticVersion.Index | %iFind.Index.Minimal |
|
This parameter can be set to 1 if the implementation of the filing interface and the SQL query interface can be executed on a shard server. The default is 0. If a sharded class attempts to use a functional index where SUPPORTSSHARDING = 0, a class compiler error will be returned.
|
This method is invoked when an existing instance of a class is deleted.
This method is invoked when a new instance of a class is inserted into the database.
This method is called when the index builder is finalizing a segment. Use this method to implement any segment cleanup work or to complete the filing of the segment. Parallel index builds typically construct segments of the index in memory and this method is a good place to copy temporary structures to the permanent index structure.
This method is called by the parallel index build to initialize an index segment when constructing index entries for one segment of the extent. Parallel index builds typically construct indexes in memory for segments of 64k instances/rows.
This method is invoked when an existing instance of a class is updated.