The
INDEXSELECTIVITY= option enables you to tune the SQL join planner strategy for more
efficient or robust index join methods. The
INDEXSELECTIVITY= setting is a continuous value between 0 and 1 that acts as a minimum
threshold value for the SPD Server duplicity ratio when selecting
a join method. The SPD Server duplicity ratio is a heuristic that
acts as a measure of the cardinality of the inner table index, relative
to the frequency of index values as they occur in the outer table.
Both
INDEXSELECTIVITY= and the SPD Server
duplicity ratio are continuous values between 0 and 1. SPD Server
compares the calculated duplicity ratio for an SPD Server index join
to the value that is specified in the
INDEXSELECTIVITY= option. If the calculated duplicity ratio is greater than or equal
to the value that is specified in the
INDEXSELECTIVITY= option, the index join method is chosen. The default setting for
the
INDEXSELECTIVITY= option is 0.7.
How is the SPD Server
duplicity ratio calculated? The duplicity ratio of an indexed column
is calculated as the number of unique values in the index column,
divided by the number of rows in the outer table. As the value of
the duplicity ratio approaches 0, indicating low cardinality, the
greater the number of duplicate values that exist in the rows of the
outer table. As the value of the duplicity ratio approaches 1, indicating
high cardinality, the fewer the number of duplicate index values in
the rows of the outer table. For example, a duplicity ratio of 1/1,
or 1, represents a unique index value for every row in the outer table,
a unique index. A duplicity ratio value of 1/2, or 0.5, represents
a unique index value for every two rows in the outer table. A duplicity
ratio value of 1/4, or 0.25, represents a unique index value for every
four rows in the outer table. The default setting of
INDEXSELECTIVITY= is 0.7, representing a unique index value for every 1.43 rows in
the outer table.
For example, consider
an outer table that contains 100 rows that match join key values in
the inner table, and a calculated SPD Server duplicity ratio of 0.7
(a unique index value per 1.43 rows in the outer table,) the expected
result set would be 100*1.43, or 143 rows.
From an efficiency perspective,
higher cardinality and index duplicity ratios are considered better
for an index join. Duplicity ratios near 1 mean more efficient processing
during probes between the outer table rows and the inner table index,
because each probe has fewer rows to retrieve. This in turn minimizes
the work the SPD Server index must do to find and retrieve the matching
rows during the join operation, resulting in an optimized index join.
You can use
INDEXSELECTIVITY= to configure the index join to be
more or less tightly constrained by the number of duplicate values
in the join table rows. Increasing the value of
INDEXSELECTIVITY= makes the duplicity criteria more selective by decreasing the allowable
average number of rows per probe of the inner table. Setting
INDEXSELECTIVITY= equal to 1.0 allows a join with a
unique index only. Setting
INDEXSELECTIVITY= to a value greater than 1.0 allows no index joins. Decreasing the
value of
INDEXSELECTIVITY= makes the duplicity
criteria more forgiving by increasing the allowable average number
of rows per probe of the inner table. Setting
INDEXSELECTIVITY= equal to 0.0 allows joins with any amount of duplicity.
Usage:
execute(reset indexselectivity=<0.0 ... 1.0>)
by sasspds ;