Enabling and disabling merge joins

By default, merge joins are enabled at the server level, for allrows mix and for allrows_dss optgoal, and are disabled at the server level for other optgoals, including allrows_oltp. When merge joins are disabled, the server costs only the other join types that are not disabled. To enable merge joins server-wide, set enable merge join to 1. The enable sort-merge joins and JTC configuration parameter from versions of Adaptive Server earlier than 15.0 does not affect the 15.0 and later query processor.

The command set merge_join on overrides the server level to allow use of merge joins in a session or stored procedure.

To enable merge joins, use:

set merge_join on

To disable merge joins, use:

set merge_join off