SET SELECTIVITY

SET SELECTIVITY

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

SET SELECTIVITY

Specifies index selectivity for indexed fields.

Syntax

SET SELECTIVITY fieldname value1 value2 value3

or

SET < fieldname> SELECTIVITY value1 value2 value3

Parameters

fieldnameThe name of an indexed field.
value1A 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.
value2A 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.
value3A 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.

See Also

SET SIZE

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish