Setting up a declarative index

You can use indexing to improve database performance and facilitate reporting by setting up a declarative index.

Note: As a best practice, do not create declarative indexes for top-level Single Value properties.

Following is a high-level description of how to set up a declarative index.

  1. Identify the property or properties on the source object that will be used for the index instance.
  2. Create a concrete class derived from the Index- base class that will contain the new index instances. For concrete classes derived from the Index- base class, the key consists of three properties pxInsIndexedKey, pxIndexCount, and pxIndexPurpose, in that order.
  3. Determine which database table will hold the new indexes. Create the database table, if necessary, and associate the table with the class using a database table instance. The three key properties must be exposed columns in the table.
  4. Define Single Value properties in the new index class to hold the values of the source instance properties. Confirm that all of these properties are exposed columns in the database, or modify the database schema as necessary.
  5. Choose a name for the Declare Index rule that describes the rule's purpose.
  6. Create a Declare Index rule, recording the source of each property value and its corresponding index property name.
  7. Save the Declare Index rule. Index processing starts immediately.