SQL/MX 3.2.1 Reference Manual (H06.26+, J06.15+)

SQL/MX Statements
HP NonStop SQL/MX Release 3.2.1 Reference Manual691117-005
2-211
Examples of EXPLAIN
ps_suppkey INT not null not droppable,
ps_availqty INT not null not droppable,
ps_supplycost NUMERIC(12,2) not null not droppable,
ps_comment VARCHAR(199) not null not droppable,
PRIMARY KEY (ps_partkey,ps_suppkey) not droppable);
Create index psx1 on partsupp
(
ps_suppkey
, ps_supplycost
, ps_availqty
);
Create index psx2 on partsupp
(
ps_partkey
, ps_suppkey
, ps_supplycost
, ps_availqty
);
To use the EXPLAIN statement with a prepared statement, prepare the query, and then
use the EXPLAIN statement:
prepare xx from
select * from part where p_partkey = (select max(ps_partkey)
from partsupp);
Use OPTIONS 'f':
>>explain options 'f' xx;
The following output is displayed:
Use OPTIONS 'e':
>>explain options 'e' xx;
LC RC OP OPERATOR OPT DESCRIPTION CARD
---- ---- ---- -------------------- -------- ---------------- ---------
7 . 8 root 1.00E+000
4 6 7 nested_join 1.00E+000
5 . 6 partition_access 1.00E+000
. . 5 file_scan_unique fr PART (s) 1.00E+000
3 . 4 partition_access 1.00E+000
2 . 3 shortcut_scalar_aggr 1.00E+000
1 . 2 firstn 1.00E+000
. . 1 index_scan PSX2 (s) 1.00E+002
--- SQL operation complete.