SET SELECTIVITY

Specifies index selectivity for indexed fields.

Syntax

SET SELECTIVITY fieldname value1 value2 value3

or

SET < fieldname> SELECTIVITY value1 value2 value3

Parameters

fieldname

The name of an indexed field.

value1

A number in the range 0.000 to 1.000. The number specifies the index selectivity for equality (=) searches.
A number above or below the acceptable range result in an error. A value1 of 1.000 instructs the software to use an internal default value for selectivity.

value2

A number in the range 0.000 to 1.000. The number specifies the index selectivity for [NOT] BETWEEN searches.
A number above or below the acceptable range results in an error. A value2 of 1.000 instructs the software to use an internal default value for selectivity.

value3

A number in the range 0.000 to 1.000. The number specifies the index selectivity for other searches (<, >, <=, >=).
A number above or below the acceptable range results in an error. A value3 of 1.000 instructs the software to use an internal default value for selectivity.

Comments

Index selectivity represents the fraction of records that you would expect to retrieve with a particular kind of search. For example, for an indexed field called Gender, you can expect an equality search to have a selectivity ratio (value1) of 0.500 (about half the records contain "male"; the other half, "female"). The strategy analyzer uses the values you supply to determine the best use of indexed fields in a retrieval operation.

The SET SELECTIVITY option has no effect on the Fields EntitySet in the Object Dictionary.

The SET SELECTIVITY option is not affected by the SET RESET and SET RESTORE commands.

Example

set selectivity Emps.Gender 0.5 0.5 0.5
set selectivity Emps.Age 0.02 0.1 0.5

The preceding commands indicate that Age is a more selective field than Gender. In a command such as find Emps where Age = 39, only about 2 per cent of the records in Emps are expected to be retrieved.

 

Related Topics