Join Index Definition
The following statement defines a join index with a three-table join using both natural and outer joins.
CREATE JOIN INDEX cust_order_join_line AS
SELECT (l_orderkey, o_orderdate, c_nationkey, o_totalprice),
(l_partkey, l_quantity, l_extendedprice, l_shipdate)
FROM (lineitem LEFT JOIN orders ON l_orderkey = o_orderkey)
INNER JOIN customer ON o_custkey = c_custkey
PRIMARY INDEX (l_orderkey);
*** Index has been created.
*** Total elapsed time was 20 seconds.