Oracle Database管理者ガイド11g リリース2 (11.2) - クラスタの概要
ã¯ã©ã¹ã¿ã¨ã¯ãjoinãããã¼ã¿ããããããé£ç¶ããé åã«ç½®ãã¦ãããã¨ã§ãã£ã¹ã¯I/Oãæ¸ããjoinã®é«éåãå³ãããã¨ãããã®ãã¯ã©ã¹ã¿ãªã³ã°ã¨ãã¨æ¦å¿µã¯ä¼¼ã¦ããã©ãæ©è½çã«ã¯å¥ã¢ããâã®ãªã³ã¯ã®æ¦è¦å³ãè¦ãã¨åãããããããããªããã§ãä»åã¯ã³ã¬ãå®éã«ä½ã£ã¦ã¿ã¦å®è¡é度ãæ¹åã§ãããã©ãããã£ã¦ã¿ããããçµè«ããè¨ãã¨ä¿ºã®è©¦è¡ã§ã¯ç¶ç¨ã®æ¹åãè¦ããã¨ãåºæ¥ãªãã£ãã俺ã®ããæ¹ãæªãã®ãããããããã¼ãããã®ãªã®ãã¯ã¤ãã¤ãä¸éæãªçµæã¨ãªã£ãã
ç°å¢
- Oracle Database Express Edition 11g Release 2ãCentOS 6.4 x86_64ä¸ã§åä½
- Oracle SQL Developer 4.0
- SQL*Plus: Release 11.2.0.2.0 Production
ãããã¨
emp表ã¨dept表ã®joinã®å®è¡é度ãè¨æ¸¬ããã1ã¤ã¯é常ã®ãã¼ãã«ã1ã¤ã¯ã¯ã©ã¹ã¿å表ãç¨ãããæ¿å ¥ãããã¼ã¿ã¯ãdeptã100件ãempã100ä¸ä»¶ãdept1件ã«ã¤ããemp10000件ãå ¥ãããé¨ç½²ã100åã§1é¨ç½²1ä¸äººã®åè¨å¾æ¥å¡ã100ä¸äººã¨ãè¬ãã¼ã¿ã ãã©ãã«ããªãã
æºå
ã¯ã©ã¹ã¿å表ã»é常ã®ãã¼ãã«ãªã©ãä½ãã
ã¯ã©ã¹ã¿
ã¯ã©ã¹ã¿ã®ä½æ
DROP CLUSTER emp_dept INCLUDING TABLES; CREATE CLUSTER emp_dept (deptno INTEGER);
ã¯ã©ã¹ã¿å表ã®ä½æ
CREATE TABLE emp ( empno INTEGER, ename VARCHAR2(10), deptno INTEGER ) CLUSTER emp_dept (deptno); CREATE TABLE dept ( deptno INTEGER, deptname VARCHAR2(10) ) CLUSTER emp_dept (deptno);
ã¯ã©ã¹ã¿ç´¢å¼ã®ä½æ
CREATE INDEX emp_dept_index ON CLUSTER emp_dept;
ãã¼ã¿ä½æã
INSERT INTO dept(deptno, deptname) SELECT ROWNUM, dbms_random.string('X', 10) FROM (SELECT ROWNUM FROM all_catalog WHERE ROWNUM <= 100); COMMIT; INSERT INTO emp(empno, ename, deptno) SELECT ROWNUM, dbms_random.string('X', 10), ceil(ROWNUM/10000) FROM (SELECT ROWNUM FROM all_catalog WHERE ROWNUM <= 1000), (SELECT ROWNUM FROM all_catalog WHERE ROWNUM <= 1000); COMMIT;
ã¡ãªã¿ã«ã¯ã©ã¹ã¿å表ã«å¯¾ãã¦ã§ãã£ã¦ãæ®éã«ã¤ã³ããã¯ã¹ãä½ããã
CREATE UNIQUE INDEX ind_dept_dept_no ON dept(deptno); CREATE INDEX ind_emp_dept_no ON emp(deptno);
é常ã®ãã¼ãã«
ã¯ã©ã¹ã¿å表ã®éãã¯ã¯ã©ã¹ã¿ã使ããã¨ããã以å¤ã¯åä¸ã®ãã¼ãã«æ§é ã»ãã¼ã¿ã使ç¨ããã
ãã¼ãã«ãä½ãã
CREATE TABLE n_dept ( deptno INTEGER, deptname VARCHAR2(10) ); CREATE TABLE n_emp ( empno INTEGER, ename VARCHAR2(10), deptno INTEGER );
ãã¼ã¿ãå ¥ããã
INSERT INTO n_dept(deptno, deptname) SELECT ROWNUM, dbms_random.string('X', 10) FROM (SELECT ROWNUM FROM all_catalog WHERE ROWNUM <= 100); COMMIT; INSERT INTO n_emp(empno, ename, deptno) SELECT ROWNUM, dbms_random.string('X', 10), ceil(ROWNUM/10000) FROM (SELECT ROWNUM FROM all_catalog WHERE ROWNUM <= 1000), (SELECT ROWNUM FROM all_catalog WHERE ROWNUM <= 1000); COMMIT;
ãã¹ãããã«ã¼ãç¨ã®ã¤ã³ããã¯ã¹ãä½ãã
CREATE INDEX ind_n_emp_dept_no ON n_emp(deptno);
ãã¼ã¿æºåçãå®äºããããã¹ãã¼ãçµ±è¨ã®åéããã¦ããã
begin DBMS_STATS.GATHER_SCHEMA_STATS ( ownname => 'KAGAMIHOGE', estimate_percent => 1 ); end;
é度è¨æ¸¬ç¨ã®ã¯ã¨ãª
é度è¨æ¸¬ç¨ã®å種é¡ã®ã¯ã¨ãªãæµãåã«æ¯åãããã¡ãã£ãã·ã¥ãã¯ãªã¢ããã
ALTER SYSTEM FLUSH BUFFER_CACHE;
é度è¨æ¸¬ã¯äºç¨®é¡è¡ãã1ã¤ã¯ãäºã¤ã®è¡¨ãjoinãã¦å ¨ä»¶æ¤ç´¢ãããã®ã1ã¤ã¯ãäºã¤ã®è¡¨ãjoinãã¦ç¯å²æ¤ç´¢ãããã®
å ¨ä»¶æ¤ç´¢ã®æ¹ããã
ã¯ã©ã¹ã¿å表ã§ä½¿ãã¯ã¨ãªãã®ï¼ããã¹ãããã«ã¼ãã¸ã§ã¤ã³ãã¦å ¨ä»¶åå¾ããã ãã
SELECT /*+ USE_NL(d e) */ d.deptno, d.deptname, e.empno, e.ename FROM dept d JOIN emp e ON d.deptno = e.deptno;
ã¯ã©ã¹ã¿å表ã§ä½¿ãã¯ã¨ãªãã®ï¼ããã¼ã¸ã¸ã§ã¤ã³ãã¦å ¨ä»¶åå¾ããã ãã
SELECT /*+ USE_MERGE(d e) */ d.deptno, d.deptname, e.empno, e.ename FROM dept d JOIN emp e ON d.deptno = e.deptno;
é常ã®ãã¼ãã«ã§ä½¿ãã¯ã¨ãªãã®ï¼ããã¹ãããã«ã¼ãã¸ã§ã¤ã³ã
SELECT /*+ USE_NL(d e) */ d.deptno, d.deptname, e.empno, e.ename FROM n_dept d JOIN n_emp e ON d.deptno = e.deptno;
é常ã®ãã¼ãã«ã§ä½¿ãã¯ã¨ãªãã®ï¼ãããã·ã¥ã¸ã§ã¤ã³ã
SELECT /*+ USE_HASH(d e) */ d.deptno, d.deptname, e.empno, e.ename FROM n_dept d JOIN n_emp e ON d.deptno = e.deptno;
ç¯å²æ¤ç´¢ã®ã¯ã¨ãªãjoinãã¦è¡¨å ¨ä½ã®10%ãããã£ã¦ããã
ã¯ã©ã¹ã¿å表ã§ä½¿ãã¯ã¨ãªãã®ï¼ããã¹ãããã«ã¼ãã¸ã§ã¤ã³ã
SELECT /*+ USE_NL(d e) */ d.deptno, d.deptname, e.empno, e.ename FROM DEPT D JOIN EMP E ON D.DEPTNO = E.DEPTNO WHERE d.deptno <= 10;
ã¯ã©ã¹ã¿å表ã§ä½¿ãã¯ã¨ãªãã®ï¼ããã¼ã¸ã¸ã§ã¤ã³ã
SELECT /*+ USE_MERGE(d e) */ d.deptno, d.deptname, e.empno, e.ename FROM DEPT d JOIN EMP E ON D.DEPTNO = E.DEPTNO WHERE d.deptno <= 10;
é常ã®ãã¼ãã«ã§ä½¿ãã¯ã¨ãªãã®ï¼ããã¹ãããã«ã¼ãã¸ã§ã¤ã³ã
SELECT /*+ USE_NL(d e) */ d.deptno, d.deptname, e.empno, e.ename FROM N_DEPT D JOIN N_EMP E ON D.DEPTNO = E.DEPTNO WHERE d.deptno <= 10;
é常ã®ãã¼ãã«ã§ä½¿ãã¯ã¨ãªãã®ï¼ãããã·ã¥ã¸ã§ã¤ã³ã
SELECT /*+ USE_HASH(d e) */ d.deptno, d.deptname, e.empno, e.ename FROM n_dept d JOIN N_EMP E ON D.DEPTNO = E.DEPTNO WHERE d.deptno <= 10;
é度è¨æ¸¬ã®æ¹æ³
SQL*Plusã§ä¸è¨ã®ã¯ã¨ãªãå®è¡ãçµãã£ããã¨ã®çµéæéã確èªããã
ã¾ããSQL*Plusã¯ä¸è¨ã®ãããªãã©ã¡ã¼ã¿è¨å®ããããä¸äºã¤ã¯ã¨ããããarraysizeã¯æéç縮ã®ããã«è¨å®ããï¼ã©ã®ã¦ãã©å¹æãããã®ãã¯ç¢ºèªãã¦ããªãããã©ï¼
set timing on set autotrace on set arraysize 100
çµæ
å®è¡è¨ç»ã¯ãã®ã¨ã³ããªã®æ«å°¾ã«ã¾ã¨ãã¦è¼ããã
å ¨ä»¶æ¤ç´¢ã
å®è¡æé
ç¨®é¡ | 1 | 2 | 3 | |
---|---|---|---|---|
ã¯ã©ã¹ã¿ ãã¹ãããã«ã¼ã | 01:10.46 | 01:23.03 | 01:15.36 | |
ã¯ã©ã¹ã¿ ãã¼ã¸ | 01:15.84 | 01:17.75 | 01:18.09 | |
é常 ãã¹ãããã«ã¼ã | 01:17.20 | 01:16.81 | 01:19.18 | |
é常 ããã·ã¥ | 01:15.46 | 01:25.00 | 01:15.62 |
autotraceã®æç²ã
ç¨®é¡ | consistent gets | physical reads |
---|---|---|
ã¯ã©ã¹ã¿ ãã¹ãããã«ã¼ã | 16343 | 6242 |
ã¯ã©ã¹ã¿ ãã¼ã¸ | 16343 | 6243 |
é常 ãã¹ãããã«ã¼ã | 27394 | 5275 |
é常 ããã·ã¥ | 13358 | 3356 |
ç¯å²æ¤ç´¢
å®è¡æé*1
ç¨®é¡ | 1 |
---|---|
ã¯ã©ã¹ã¿ ãã¹ãããã«ã¼ã | 00:11.21 |
ã¯ã©ã¹ã¿ ãã¼ã¸ | 00:10.92 |
é常 ãã¹ãããã«ã¼ã | 00:10.48 |
é常 ããã·ã¥ | 00:10.48 |
autotraceã®æç²ã
ç¨®é¡ | consistent gets | physical reads |
---|---|---|
ã¯ã©ã¹ã¿ ãã¹ãããã«ã¼ã | 1649 | 310 |
ã¯ã©ã¹ã¿ ãã¼ã¸ | 1630 | 310 |
é常 ãã¹ãããã«ã¼ã | 2715 | 530 |
é常 ããã·ã¥ | 2539 | 530 |
ææ³ã¨ã
å ¨ä»¶æ¤ç´¢ã®å®è¡æéã¯ã»ã¨ãã©å·®ã¯è¦ãããªãã£ãã
é常ãã¼ãã«ã®ããã·ã¥ã¸ã§ã¤ã³ã«ã¤ãã¦ããããæãconsistent gets, physical readsãå°ãªããautotraceã®ãã®é¨åã ããæ¯è¼ããã¨ããããä¸çªåªä½ã¨ããããé§å表ã®dept表ã¯100件ã¨å°ãªãã®ã§ããã·ã¥ä½æå¦çã¯ä¸ç¬ã§çµããããã®ããããã¨ã¯emp表ãé 次ã¢ã¯ã»ã¹ãã¦ããã°è¯ãã ãã§ããããã£ã¦ãå®è³ªçã«ã¯emp表ããã«ã¹ãã£ã³ãã¦ãã ãã«ãªãã®ã§ã¢ã¯ã»ã¹ãããã¯ãå°ãªããªãã®ã¯å½ç¶ã§ããã
é常ãã¼ãã«ã®ãã¹ãããã«ã¼ãã¸ã§ã¤ã³ã«ã¤ãã¦ãå è¿°ã®ããã·ã¥ã¸ã§ã¤ã³ã¨ç°ãªããã¤ã³ããã¯ã¹çµç±ã®ãã¼ãã«ã¢ã¯ã»ã¹ãå¿ è¦ã¨ãªãããã£ã¦ãã¢ã¯ã»ã¹ãããã¯ã®å·®ã¯ã¤ã³ããã¯ã¹ã®åã ãå¢å ããããã ããããä¸å©ãã¨ããã¨å¥ã«ããã§ããªãããã®çç±ã¯ããã¹ããã¼ã¿ä½æã®SQLãåä¸deptnoã®empè¡ã¯åºãã¦æ¿å ¥ãã¦ããããã§ãããemp表ãrowidã§ã¢ã¯ã»ã¹ãã«ãã£ã¦ãããã®æ¬¡ã®rowideããã£ãã®ãããã¯ã«ã»ã¨ãã©ãå«ã¾ãã¦ããã®ã§ãä½è¨ãªãããã¯ã¢ã¯ã»ã¹ã¯ã»ã¨ãã©çºçããªãããºã§ããã
ã¯ã©ã¹ã¿å表ã®ãã¹ãããã«ã¼ãã¸ã§ã¤ã³ã«ã¤ãã¦ãå®è¡è¨ç»ã¯ãdeptããã«ã¹ãã£ã³ããªããempãclusterã¢ã¯ã»ã¹ãã¦ãããã¯ã©ã¹ã¿ãã¼ã¯deptã®deptnoã«ç½®ãã¦ããã®ã§ãdeptã®ããdeptnoã«è¾¿ãçãããããããã¯ã©ã¹ã¿ãæ§æãããããã¯ã辿ãã°è¯ãã ããã¨ãªããæ©ããªããããªæ°ããããã©â¦â¦ããã§ããªãã£ãã
çµååã®æ¡ä»¶ã§ãããã¯ã並ãã§ããã®ã§ããã«ã¹ãã£ã³ã¯ä½ãã¦ã大ãã¦å¤ãããªãæ°ããããã¾ããã¯ã©ã¹ã¿ãã¼ã®ç¯å²ãç²ãã®ã§ãããã·ã¥ã¸ã§ã¤ã³ã§å¹çè¯ãå¦çã§ãã¦ãã¾ã£ã¦ãããããããèããããã®ã¯ãã¯ã©ã¹ã¿å表ãæå¹ã§ããããã«ã¯ãå°ãªãã¨ãããã·ã¥ã¸ã§ã¤ã³ãå¹æçã§ã¯ç¡ãã»ã©ã«ã¯ã¯ã©ã¹ã¿ãã¼ãç´°ããç²åº¦ãåããªããã°ãªããªãã®ã§ã¯ï¼ãã¨ããç¹ã
ããã§10%ãè¿ãç¯å²æ¤ç´¢ã®çµæãè¦ã¦ã¿ãããããã«å®è¡æéã«å¤§ããå·®ã¯çããªãããautotraceã®consistent gets, physical readsã¯èå³æ·±ãã
ãããã¯ã¢ã¯ã»ã¹æ°ã®å·®ã¯ã¤ã³ããã¯ã¹ã®å·®ã«ãããé常ãã¼ãã«ã®å ´åãç¯å²ã¹ãã£ã³ã«ã¯ã©ãããã£ã¦ã¤ã³ããã¯ã¹ã使ããããå¾ãªãããã®åã ããããã¯æ°ãå¤ããªãã
ã¯ã©ã¹ã¿å表ã®å ´åãã¯ã©ã¹ã¿ãã¼ã®deptnoã®ä½ç½®ãåããã°ããããé 次ã¢ã¯ã»ã¹ããã°empã®ãã¼ã¿ãåå¾ã§ãããé常ãã¼ãã«ã®joinã¨ç°ãªããã¤ã³ããã¯ã¹ãä¸ç¶ããå¿ è¦ãç¡ããã¾ããã¯ã©ã¹ã¿ãã¼å ã«ã¯çµåæ¡ä»¶ã«å½ã¦ã¯ã¾ããªãempã®ãã¼ã¿ã¯çµ¶å¯¾ã«å ¥ã£ã¦ããªãããªã®ã§ãã£ã«ã¿ããå¿ è¦ããªããé常ãã¼ãã«ã¯ãï¼ç¹ã«ããããæä½ãããªããã°ï¼è¡ãã©ã®ãããªé åºã§å ¥ã£ã¦ããããå¼·å¶ã§ããªãããã¼ã¿ãã©ããªé åºã§å ¥ã£ã¦ããããæ°ã«ããªãã§æ¸ãã®ããªã¬ã¼ã·ã§ãã«ãªä¸çã®ã¡ãªãããªã®ã ãã©ããããã¯ã©ã¹ã¿å表ã¯æãæ¨ã¦ã¦ãããã¨ã«ãªãã
ã¯ã©ã¹ã¿å表ãæãæ¨ã¦ã¦ãããã¨ã¨ã¯ä½ããRDBMSã«ã¨ã£ã¦ããããã®è¡¨ã¯ããããåç¬ã§åå¨ãã¦ãããã¯ã©ã¹ã¿å表ã¯ç©ççã«çµã³ä»ãã¦ããã®ã§ãããããã®è¡¨ãåç¬ã§æ±ããã¨ããã¨é端ã«ä¸å©ã«ãªããä¸è¨ã®ãããªãdeptãã¼ãã«ã®ã¿ãæ¤ç´¢ããã¯ã¨ãªãå®è¡ãã¦ã¿ãã
SELECT d.deptno, d.deptname FROM dept d; SELECT d.deptno, d.deptname FROM n_dept d;
autotraceã®çµæã¯ãããªæãã
ç¨®é¡ | consistent gets | physical reads |
---|---|---|
ã¯ã©ã¹ã¿ | 3144 | 3143 |
é常 | 7 | 6 |
é常ã®å ´å100ä»¶å ¥ã£ã¦ãdeptãè¦ãã°ããã§æ¸ããã©ãã¯ã©ã¹ã¿ã¯ããã¯ãããªããã¯ã©ã¹ã¿å表ã®ã©ããããdeptã®è¡ãåãããªããããªãæªãã®ã¯ãããããã¯ã®ã»ãã®ä¸é¨åã ããdeptã«éããªãã®ã§ã¢ã¯ã»ã¹å¹çã¯ææªã§ãããæããã¯ã©ã¹ã¿å表ã«ãã¤ã³ããã¯ã¹ã¯å¼µããã®ã§é å¼µãã°ããç¨åº¦ã¯æ½åã§ããã ãããã©ãæ§é çã«é£ãããã®ãã«ãã¼ããã®ã¯æªæã¨ãããã
ãªã®ã§ãããããã®è¡¨ãåç¬ã§ä½¿ããããã¨ããè²ããªãã¼ãã«ã¨joinããäºå®ãã¨ãã®å ´åã«ã¯ã¯ã©ã¹ã¿ã¯ä½¿ããªãæ¹ãè¯ãã¨è¨ãããéãè¨ãã¨ãããããæè»æ§ãæ¨ã¦ã¦ã§ãjoinã®å¹çãä¸ãããã±ã¼ã¹ã«ãã使ããªãã®ã§ã¯ï¼ãã¨ä¿ºã¯æããã
ã¯ã©ã¹ã¿ãã¼ã®åå¸ãéè¦ããã§ãããè¦ã¯joinããã¨ãã®ãããã¯ã¢ã¯ã»ã¹ã®ã³ã¹ããæå°ã«ãªãã°è¯ãããã§ãããã¯ã©ã¹ã¿ã¯æåããjoinããç¶æ ã«ãã¦ãã¾ããã¨ã«æ義ãããããã ããã¯ã©ã¹ã¿ãã¼ã®åå¸ããã¾ãã«å°ãªãã¨ãã®ã¨ã³ããªã§è¦ãããã«ããã·ã¥ã¸ã§ã¤ã³ã§è¯ãããå¤ãã¨ã¯ã©ã¹ã¿ã«ã¾ã¨ãã¦ä¿æããè¡ãå°ãªããªãé常ã®joinã¨ç¸å¯¾çã«å·®ãã¤ããªããªãããã§ããããããã©ã®ç¨åº¦ãªã®ãã¯ã¡ãã£ã¨åãããªãããã©ãâ¦â¦
ã¨ãããã¯ã©ã¹ã¿ã§å¹æãä¸ããã®ã¯ãåãã±ã¼ã¹ãéããªãçãããªã®ã§ã使ãããªãã®ã¯é£ãããã ãªãâ¦â¦ã¨æããã®ã§ããã
å®è¡è¨ç»ï¼å ¨ä»¶åå¾ï¼
ã¯ã©ã¹ã¿ ãã¹ãããã«ã¼ã
------------------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | | 998K| 31M| 3857 (1)| 00:00:47 | | 1 | NESTED LOOPS | | 998K| 31M| 3857 (1)| 00:00:47 | | 2 | TABLE ACCESS FULL | DEPT | 100 | 1400 | 855 (1)| 00:00:11 | |* 3 | TABLE ACCESS CLUSTER| EMP | 9983 | 185K| 30 (0)| 00:00:01 | ------------------------------------------------------------------------------ Predicate Information (identified by operation id): --------------------------------------------------- 3 - filter("D"."DEPTNO"="E"."DEPTNO")
ã¯ã©ã¹ã¿ ãã¼ã¸ã¸ã§ã¤ã³
---------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 998K| 31M| 957 (1)| 00:00:12 | | 1 | MERGE JOIN | | 998K| 31M| 957 (1)| 00:00:12 | | 2 | TABLE ACCESS CLUSTER| EMP | 998K| 18M| 101 (0)| 00:00:02 | | 3 | INDEX FULL SCAN | EMP_DEPT_INDEX | 1 | | 1 (0)| 00:00:01 | |* 4 | SORT JOIN | | 100 | 1400 | 856 (1)| 00:00:11 | | 5 | TABLE ACCESS FULL | DEPT | 100 | 1400 | 855 (1)| 00:00:11 | ---------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 4 - access("D"."DEPTNO"="E"."DEPTNO") filter("D"."DEPTNO"="E"."DEPTNO")
é常 ãã¹ãããã«ã¼ãã¸ã§ã¤ã³
------------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 999K| 31M| 6342 (1)| 00:01:17 | | 1 | NESTED LOOPS | | | | | | | 2 | NESTED LOOPS | | 999K| 31M| 6342 (1)| 00:01:17 | | 3 | TABLE ACCESS FULL | N_DEPT | 100 | 1400 | 3 (0)| 00:00:01 | |* 4 | INDEX RANGE SCAN | IDX_N_EMP_DEPTNO | 10069 | | 20 (0)| 00:00:01 | | 5 | TABLE ACCESS BY INDEX ROWID| N_EMP | 9996 | 185K| 63 (0)| 00:00:01 | ------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 4 - access("D"."DEPTNO"="E"."DEPTNO")
é常 ããã·ã¥ã¸ã§ã¤ã³
----------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ----------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 999K| 31M| 952 (3)| 00:00:12 | |* 1 | HASH JOIN | | 999K| 31M| 952 (3)| 00:00:12 | | 2 | TABLE ACCESS FULL| N_DEPT | 100 | 1400 | 3 (0)| 00:00:01 | | 3 | TABLE ACCESS FULL| N_EMP | 999K| 18M| 940 (3)| 00:00:12 | ----------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - access("D"."DEPTNO"="E"."DEPTNO")
å®è¡è¨ç»ï¼ç¯å²æ¤ç´¢ï¼
ã¯ã©ã¹ã¿ ãã¹ãããã«ã¼ã
---------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 10165 | 327K| 312 (0)| 00:00:04 | | 1 | NESTED LOOPS | | 10165 | 327K| 312 (0)| 00:00:04 | | 2 | TABLE ACCESS CLUSTER| DEPT | 10 | 140 | 12 (0)| 00:00:01 | |* 3 | INDEX RANGE SCAN | EMP_DEPT_INDEX | 1 | | 1 (0)| 00:00:01 | |* 4 | TABLE ACCESS CLUSTER| EMP | 1007 | 19133 | 30 (0)| 00:00:01 | ---------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 3 - access("D"."DEPTNO"<=10) 4 - filter("E"."DEPTNO"<=10 AND "D"."DEPTNO"="E"."DEPTNO")
ã¯ã©ã¹ã¿ ãã¼ã¸ã¸ã§ã¤ã³
----------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ----------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 10165 | 327K| 25 (4)| 00:00:01 | | 1 | MERGE JOIN | | 10165 | 327K| 25 (4)| 00:00:01 | | 2 | TABLE ACCESS CLUSTER | EMP | 100K| 1869K| 12 (0)| 00:00:01 | |* 3 | INDEX RANGE SCAN | EMP_DEPT_INDEX | 1 | | 1 (0)| 00:00:01 | |* 4 | SORT JOIN | | 10 | 140 | 13 (8)| 00:00:01 | | 5 | TABLE ACCESS CLUSTER| DEPT | 10 | 140 | 12 (0)| 00:00:01 | |* 6 | INDEX RANGE SCAN | EMP_DEPT_INDEX | 1 | | 1 (0)| 00:00:01 | ----------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 3 - access("E"."DEPTNO"<=10) 4 - access("D"."DEPTNO"="E"."DEPTNO") filter("D"."DEPTNO"="E"."DEPTNO") 6 - access("D"."DEPTNO"<=10)
é常 ãã¹ãããã«ã¼ãã¸ã§ã¤ã³
--------------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | --------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 10459 | 337K| 255 (2)| 00:00:04 | | 1 | NESTED LOOPS | | | | | | | 2 | NESTED LOOPS | | 10459 | 337K| 255 (2)| 00:00:04 | | 3 | TABLE ACCESS BY INDEX ROWID| N_DEPT | 10 | 140 |2 (0)| 00:00:01 | |* 4 | INDEX RANGE SCAN | IDX_N_DEPT_DEPTNO | 10 | |1 (0)| 00:00:01 | |* 5 | INDEX RANGE SCAN | IDX_N_EMP_DEPTNO | 1051 | | 20 (0)| 00:00:01 | | 6 | TABLE ACCESS BY INDEX ROWID | N_EMP | 1037 | 19703 | 25 (0)| 00:00:01 | --------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 4 - access("D"."DEPTNO"<=10) 5 - access("D"."DEPTNO"="E"."DEPTNO") filter("E"."DEPTNO"<=10)
é常 ããã·ã¥ã¸ã§ã¤ã³
-------------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost(%CPU)| Time | -------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 10459 | 337K| 650 (1)| 00:00:08 | |* 1 | HASH JOIN | | 10459 | 337K| 650 (1)| 00:00:08 | | 2 | TABLE ACCESS BY INDEX ROWID| N_DEPT | 10 | 140 | 2 (0)| 00:00:01 | |* 3 | INDEX RANGE SCAN | IDX_N_DEPT_DEPTNO | 10 | | 1 (0)| 00:00:01 | | 4 | TABLE ACCESS BY INDEX ROWID| N_EMP | 103K| 1923K| 647 (1)| 00:00:08 | |* 5 | INDEX RANGE SCAN | IDX_N_EMP_DEPTNO | 105K| | 210 (1)| 00:00:03 | -------------------------------------------------------------------------------- ------------------ Predicate Information (identified by operation id): --------------------------------------------------- 1 - access("D"."DEPTNO"="E"."DEPTNO") 3 - access("D"."DEPTNO"<=10) 5 - access("E"."DEPTNO"<=10)
*1:ã³ãã©ã¯ããã©ããªã£ã¦1åãã試è¡ãã¦ãªã