OPTCOMPIND environment variable

You can set the OPTCOMPIND environment variable so that the optimizer can select the appropriate join method.
Read syntax diagramSkip visual syntax diagram

A nested-loop join is preferred, where possible, over a sort-merge join or a hash join.
When the isolation level is not Repeatable Read, the optimizer behaves as in setting 2; otherwise, the optimizer behaves as in setting 0.
Nested-loop joins are not necessarily preferred. The optimizer bases its decision purely on costs, regardless of transaction isolation mode.

When OPTCOMPIND is not set, the database server uses the OPTCOMPIND value from the ONCONFIG configuration file. When neither the environment variable nor the configuration parameter is set, the default value is 2.

On HCL Informix®, the SET ENVIRONMENT OPTCOMPIND statement can set or reset OPTCOMPIND dynamically at runtime. This overrides the current OPTCOMPIND value (or the ONCONFIG configuration parameter OPTCOMPIND) for the current user session only. For more information about the SET ENVIRONMENT OPCOMPIND statement of SQL see the IBM® Informix Guide to SQL: Syntax.

For more information about the ONCONFIG configuration parameter OPTCOMPIND, see the IBM Informix Administrator's Reference. For more information about the different join methods that the optimizer uses, see your IBM Informix Performance Guide.

Copyright© 2018 HCL Technologies Limited