RAD Studio |  |

Sorting and Indexing
See Also
Collapse All

Using indexes provides several benefits to your applications:

- They allow client datasets to locate data quickly.
- They let you apply ranges to limit the available records.
- They let your application set up relationships with other datasets such as lookup tables or master/detail forms.
- They specify the order in which records appear.

If a client dataset represents server data or uses an external provider, it inherits a default index and sort order based on the data it receives. The default index is called DEFAULT_ORDER. You can use this ordering, but you cannot change or delete the index.

In addition to the default index, the client dataset maintains a second index, called CHANGEINDEX, on the changed records stored in the change log (Delta property). CHANGEINDEX orders all records in the client dataset as they would appear if the changes specified in Delta were applied. CHANGEINDEX is based on the ordering inherited from DEFAULT_ORDER. As with DEFAULT_ORDER, you cannot change or delete the CHANGEINDEX index.

You can use other existing indexes, and you can create your own indexes. The following sections describe how to create and use indexes with client datasets:

- Adding a new index
- Deleting and switching indexes
- Using indexes to group data

Note: You may also want to review the material on indexes in table type datasets, which also applies to client datasets. This material is in Using Indexes to search for records and Limiting records with ranges.
See Also

Navigating Data in Client Datasets

Limiting What Records Appear

Constraining Data Values

Editing Data

Representing Calculated Values

Adding Application-specific Information to the Data

Copying Data from Another Dataset

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!