INDEX Attribute

In this section:

How to:

Index the values of a field by including the INDEX attribute, or its alias of FIELDTYPE, in the field declaration. An index is an internally stored and maintained table of data values and locations that speeds retrieval. You must create an index to:


Top of page

x
Syntax: How to Specify Field Indexing

The syntax of the INDEX attribute in the Master File is:

INDEX = I or FIELDTYPE = I

Text fields cannot be indexed. The maximum field name length for indexed fields in a FOCUS data source is 12 characters. The maximum field name length for indexed fields in an XFOCUS data source is 66 characters.



Example: Specifying an Index for the JOBCODE Field
FIELDNAME = JOBCODE, ALIAS = CJC, FORMAT = A3, INDEX = I, $

Top of page

x
Joins and the INDEX Attribute

Reference:

In order to be cross-reference a segment with a static cross-reference, a dynamic cross-reference, or an equijoin, at least one field in the segment must be indexed. This field, called the cross-referenced field, shares values with a field in the host data source. Only the cross-referenced segment requires an indexed field, shown as follows:

Other data sources locate and use segments through these indexes. Any number of fields may be indexed on a segment, although it is advisable to limit the number of fields you index in a data source.

The value for the field named JOBCODE in the EMPLOYEE data source is matched to the field named JOBCODE in the JOBFILE data source by using the index for the JOBCODE field in the JOBFILE data source, as follows:

Indexes are stored and maintained as part of the FOCUS data source. The presence of the index is crucial to the operation of the cross-referencing facilities. Any number of external sources may locate and thereby share a segment because of it. New data sources which have data items in common with indexed fields in existing data sources can be added at any time.



x
Reference: Usage Notes for INDEX

Note the following rules when using the INDEX attribute:


Top of page

x
FORMAT and MISSING: Internal Storage Requirements

Some application developers find it useful to know how different data types and values are represented and stored internally:


WebFOCUS