Background documentationIN CONDITION FOR KEY Locate this document in the navigation structure


IN CONDITION FOR KEY is a search strategy of the SQL optimizer.

When Can the System Use This Strategy?

The database system chooses this search strategy in the following situation: The first k-1 columns of the primary key were specified with equality conditions and an IN condition was defined for the kth key column (1 ≤ k ≤ n, n = number of key columns).

If the values of the IN condition are close together, or if many values were specified, it may be more practical for the database system to use a range condition instead of an equality condition. In this case, the range condition is displayed in the execution plan.

How Does the System Access the Data?

The database system processes the individual values of the IN condition as an equality condition. It accesses the table rows directly. It creates an intermediate result set.