Products   Support   Download   Contact

Improving Performance with First And Last Keys

return to contents or index

Abstract

Specifying first and last keys to read for a primary file can greatly improve performance. Since v4.4, XENTIS allows multiple first/last key ranges.

Discussion

Effect of First and Last Keys compare to Selection Logic

Selection logic is the obvious way to select the records which are included in a report. If most or all of the records in the (primary) file are to be included in the report, that's perfectly fine from a performance standpoint regardless of the size of the file.

However:

then specifying first and last keys to read can greatly improve performance. This is the case when, for instance, there is a shipping history and you want to report on information for a narrow timeframe. Or, when you want information for all destinations in a particular city or state. Specifying first and last keys can result in only a small fraction of the records being read, instead of reading the entire file.

Multiple First and Last Key Ranges

XENTIS since v4.4 allows the user to respond with multiple ranges for the "First key to read" and "Last key to read" prompts for the primary file. This is done by entering multiple ranges at the prompts with each range separated by the delimiter specified by the FIRST-KEY-RANGE-DEL setup file parameter. The default parameter value is a semicolon, (;).

For example, if reading the customer file using the customer name index and you wish to access all customers whose names begin with A,C, E, or G, you would respond as follows at both the "First key to read" and "Last key to read" prompts:

First key to read? A;C;E;G

Last key to read? A;C;E;G

If more than one range is specified for the first key then an identical number of ranges must be specified for the last key.

© 2020 GrayMatter Software Corporation