スケーラブルデータベースサーバ HiRDB Version 8 SQLリファレンス
SQL最適化指定の使用例を次に示します。
SELECT SNAME FROM ZAIKO WITH INDEX (IDX1) WHERE TANKA <= 500
SELECT SNAME FROM ZAIKO WITH INDEX (IDX1,IDX2) WHERE TANKA <= 500 OR ZSURYO > 100
SELECT SNAME FROM ZAIKO WITH INDEX (PRIMARY KEY) WHERE TANKA <= 500
SELECT SNAME FROM ZAIKO WITHOUT INDEX WHERE TANKA <= 500
SELECT ZAIKO.SCODE,ZAIKO.SNAME,JUTYU.TCODE FROM ZAIKO INNER JOIN BY NEST JUTYU ON ZAIKO.SCODE = JUTYU.SCODE
SELECT ZAIKO.SCODE,ZAIKO.SNAME,JUTYU.TCODE FROM ZAIKO LEFT OUTER JOIN BY HASH JUTYU ON ZAIKO.SCODE = JUTYU.SCODE
SELECT ZAIKO.SCODE,ZAIKO.SNAME,JUTYU.TCODE FROM ZAIKO JOIN BY MERGE JUTYU ON ZAIKO.SCODE = JUTYU.SCODE
SELECT SNAME FROM ZAIKO WHERE SCODE =ANY (HASH SELECT SCODE FROM JUTYU WHERE TCODE = '302S')
SELECT SNAME FROM ZAIKO WHERE SCODE =ANY (NO HASH SELECT SCODE FROM JUTYU WHERE TCODE = '302S')
SELECT SNAME FROM ZAIKO /*>> WITH INDEX (IDX1) <<*/ WHERE TANKA <= 500
SELECT ZAIKO.SCODE,ZAIKO.SNAME,JUTYU.TCODE FROM ZAIKO INNER JOIN /*>> BY NEST <<*/ JUTYU ON ZAIKO.SCODE = JUTYU.SCODE
SELECT SNAME FROM ZAIKO WHERE SCODE =ANY (/*>> HASH <<*/ SELECT SCODE FROM JUTYU WHERE TCODE = '302S')
SELECT ZAIKO.SCODE,ZAIKO.SNAME,JUTYU.TCODE FROM ZAIKO WITH INDEX (IDX3) JOIN BY HASH JUTYU ON ZAIKO.SCODE = JUTYU.SCODE
SELECT ZAIKO.SCODE,ZAIKO.SNAME,JUTYU.TCODE FROM ZAIKO /*>> WITH INDEX (IDX3) <<*/ JOIN /*>> BY HASH <<*/ JUTYU ON ZAIKO.SCODE = JUTYU.SCODE
All Rights Reserved. Copyright (C) 2006, 2016, Hitachi, Ltd.