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.
To set up a declarative index, perform the following actions:
- Identify the property or properties on the source object that will be used for the index instance.
- 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.
- 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.
-
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. - Choose a name for the Declare Index rule that describes the rule's purpose.
- Create a Declare Index rule, recording the source of each property value and its corresponding index property name.
- Save the Declare Index rule. Index processing starts immediately.