NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
C-70
Examples—CONTROL EXECUTOR
ExamplesCONTROL EXECUTOR
The following example shows an equijoin operation:
CONTROL EXECUTOR PARALLEL EXECUTION ON;
SELECT CUSTOMER.CUSTNUM, CUSTOMER.CUSTNAME
FROM =CUSTOMER, =ORDERS
WHERE CUSTOMER.CUSTNUM = ORDERS.CUSTNUM
STABLE ACCESS;
CONTROL QUERY Directive
CONTROL QUERY is an SQL compiler directive that controls plans for queries.
Options specify whether to resolve names at execution time or at SQL startup time,
whether to include hash join algorithms among algorithms considered for executing
queries, and whether to optimize query response time for returning a few rows or all
rows.
BIND NAMES { AT EXECUTION | AT STARTUP }
specifies when to resolve names of SQL objects and catalogs in DDL, DML, and
DSL (GET) statements and in DCL statements other than CONTROL TABLE:
The default is BIND NAMES AT STARTUP.
For a cursor, the execution time for the OPEN statement is considered the execution
time for the SELECT statement within the DECLARE CURSOR statement.
(Neither DECLARE CURSOR, FETCH, nor CLOSE causes name resolution.)
BIND NAMES AT EXECUTION can lead to unnecessary automatic recompilations
unless you specify the CHECK INOPERABLE PLANS option when you explicitly
compile the program. For more information about name resolution and its
relationship to compilation options, see the NonStop SQL/MP programming manual
for your host language.
Note that BIND NAMES does not affect the host compiler directive INVOKE or the
DCL statement CONTROL TABLE.
{| BIND NAMES {AT EXECUTION} | AT STARTUP |}
CONTROL QUERY {| HASH JOIN { OFF | ENABLE | SYSTEM } |}
{| INTERACTIVE ACCESS { ON | OFF } |}
{| MDAM { ON | OFF } |}
AT EXECUTION Resolves names just before each statement executes
AT STARTUP Resolves names just before the first SQL statement of the program
executes (static SQL) or when the PREPARE or EXECUTE
IMMEDIATE executes (SQLCI and dynamic SQL)