25.01.2015 Views

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9<br />

Indices<br />

Indexes provide a mechanism for optimizing searches across the instances of a persistent<br />

class; they define a specific sorted subset of commonly requested data associated with a class.<br />

They are very helpful in reducing overhead for performance-critical searches.<br />

Indexes automatically span the entire extent of the class in which they are defined. If a Person<br />

class has a subclass Student, all indexes defined in Person contain both Person objects and<br />

Student objects. Indexes defined in the Student class contain only Student objects.<br />

Indexes can be sorted on one or more properties belonging to their class. This allows you a<br />

great deal of specific control of the order in which results are returned. (See the Properties<br />

keyword, below.)<br />

In addition, indexes can store additional data that is frequently requested by queries based<br />

on the sorted properties. By including additional data as part of an index, you can greatly<br />

enhance the performance of the query that uses the index; when the query uses the index to<br />

generate its result set, it can do so without accessing the main data storage facility. (See the<br />

Data keyword below.)<br />

For additional information on indices, refer to the Index chapter within <strong>Using</strong> <strong>Caché</strong> SQL.<br />

9.1 Index Keywords<br />

You can modify an index definition through the use of one or more index keywords. Each<br />

keyword is optional and has a default value if not explicitly specified.<br />

The available index keywords include:<br />

<strong>Using</strong> <strong>Caché</strong> <strong>Objects</strong> 63

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!