SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-43
Examples of CONTROL QUERY SHAPE
or
SCAN (TABLE 'T1', PATH ANY)
°
Scan table T1 using the base table. You want the system to choose whether to
use MDAM.
SCAN (TABLE 'T1', PATH 'T1')
°
Scan table T1 using the index IT1. You want the system to choose whether to
use MDAM.
SCAN (TABLE 'T1', PATH 'IT1')
°
Scan table T1 using the index IT1. You want to disable MDAM.
SCAN (TABLE 'T1', PATH 'IT1', MDAM OFF)
°
Scan table T1 using MDAM on index IT1. You want the system to choose the
number of MDAM key columns and the enumeration algorithm for each
column.
SCAN (TABLE 'T1', PATH 'IT1', MDAM FORCED)
°
Scan table T1 using MDAM on columns C, D, and E of index IT1. You want the
system to choose the enumeration algorithm for each column.
SCAN (TABLE 'T1', PATH 'IT1', MDAM FORCED,MDAM_COLUMNS 3)
or
SCAN (TABLE 'T1', PATH 'IT1', MDAM_COLUMNS 3)
°
Scan table T1 using MDAM on columns C, D, and E of index IT1. The
enumeration algorithms for columns C and E are adaptive dense and sparse
respectively. You want the system to choose the enumeration algorithm for
column D.
SCAN (TABLE 'T1', PATH 'IT1',
MDAM_COLUMNS (DENSE,SYSTEM,SPARSE))
Suppose that you are trying to refine a shape. You want to push a GROUPBY
operator down over a hybrid hash join between two tables, A and B. Until the
shape is final, you are not concerned with sorts for a possible SORT GROUPBY or
a final ordering, or about EXCHANGE nodes. You might add those nodes back
after you have finalized the shape:
CONTROL QUERY SHAPE WITHOUT ENFORCERS
hybrid_hash_join(groupby(scan('A')), scan('B'));
optimizer/opt.cpp
optimizer/opt.h
optimizer/OptPhysRelExpr.cpp
optimizer/PhyProp.cpp
optimizer/RelControl.h
optimizer/RelExpr.cpp
parser/ParKeyWords.cpp