AGGREGATION_PREFERENCE option

Function

Controls the choice of algorithms for processing an aggregate.

Allowed values

-3 to 3

Scope

DBA permissions are not required to set this option. Can be set temporary, for an individual connection, or for the PUBLIC group. Takes effect immediately.

Default

0

Description

For aggregation (GROUP BY, DISTINCT, SET functions) within a query, the IQ optimizer has a choice of several algorithms for processing the aggregate. This option allows you to override the optimizer's costing decision when choosing the algorithm to use. It does not override internal rules that determine whether an algorithm is legal within the query engine.

This option is normally used for internal testing and for manually tuning queries that the optimizer does not handle well. Only experienced DBAs should use it. Inform Sybase Technical Support if you need to set AGGREGATION_PREFERENCE, as setting this option may mean that a change to the optimizer is appropriate.

The following table describes the valid values for this option and their action.

Table 2-5: AGGREGATION_PREFERENCE values

Value

Action

0

Let the optimizer choose

1

Prefer aggregation with a sort

2

Prefer aggregation using IQ's indexes

3

Prefer aggregation with a hash

-1

Avoid aggregation with a sort

-2

Avoid aggregation using IQ's indexes

-3

Avoid aggregation with a hash