SQL/MX 2.x Reference Manual (H06.10+, J06.03+)
SQL/MX Statements
HP NonStop SQL/MX Reference Manual—544517-008
2-147
Examples of EXPLAIN
p_comment varchar(23) not null not droppable,
primary key (p_partkey) not droppable);
Create unique index px1 on part
(
p_type
, p_size
, p_mfgr
, p_brand
, p_container
, p_partkey
);
Run the following commands to create a table ‘partsupp’ and indexes psx1 and psx2:
Create table partsupp (
ps_partkey int not null not droppable,
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;










