Click here to load reader

Optimizer operators

  • View
    383

  • Download
    5

Embed Size (px)

DESCRIPTION

Optimizer operators

Text of Optimizer operators

  • 1. Optimizer operators 1. 1.Unary Operations:,; 2.Binary Operations:,; 3.N-ary Operations:; 2.: 1.: 1.Full Table Scan; 2.Rowid Scan:,; 3.Sample Table Scan:; 2.: 1.Index Scan(Unique); 2.Index Scan(Range); 3.Index Scan(Full); 4.Index Scan(Fast Full); 5.Index Scan(Skip); 6.Index Scan(Index Join); 7.Using Bitmap Indexes; 8.Combining Bitmap Indexes; 3.: 1.B-Tree Indexes:,; 1. ;
  • 2. 2.: 1. ; 2. ;
  • 3. 3.IOT(Index-Organized Table): ,,, ; 4.Bitmap Indexes; 1.; 2.:TO ROWIDS/FROM ROWIDS/COUNT; 3. :MERGE/AND/OR/MINUS/KEY ITERATION,; 4. SINGLE VALUE/ RANGE SCAN/ FULL SCAN ; 5.,; 5.Cluster Indexes; 1. ; 2.CLUSTER ;; ;
  • 4. 3., ;ORACLE ; 4.cluster , ; 5. cluster segment; 2.: 1.; 2.():(buffer busy wait),,; 3./; 3. NULL : 1.NULL : 1., NULL (NULL NULL), NULL ; 2., NULL ([NULL, NULL] [NULL, NULL]),, NULL ,; 2.NULL :
  • 5. 1. NULL, IS NULL ,, NULL ; 2. NULL, IS NOT NULL ,; 3. NOT NULL, IS [NOT] NULL ,; 4., ; 5.,, ; 3.IS NULL : 1. NULL :nvl(column_name, -1), : where nvl(column_name, -1) = -1; 2. NULL ; 4.: 1., DW ; 2.; 3.; 4.:,DML 3 , 7 ;
  • 6. 5.; 6.; 7.,NOLOGGING ; 8.COALESCING ,rebuild ; 5.: 1.:ALTER INDEX EMP_EMP_ID_PK MONITORING USAGE; 2.:SELECT * FROM v$object_usage; ; 3. ;
  • 7. 4.:ALTER INDEX EMP_EMP_ID_PK NOMONITORING USAGE; 5.:, ; 6.: 1.; 2.; ,; 3.; 4.; 5.;
  • 8. 4.: 1.Full Table Scan: 1. Multiblock Reads, :db_file_multiblock_read_count; 2. HWM(High-Water Mark) ; 3.; 4.,; 5.: 1.; 2.,; 3.,; 4.,, :SELECT /*+ PARALLEL(d 4) */ * FROM departments
  • 9. d; 5. hint :SELECT /*+ FULL (d)*/ * FROM departments d WHERE department_id = 10; 6.IS NULL ;
  • 10. 2.ROWID Scan: 1. rowid ,, ,; 2. : 3.Sample Table Sacns:,SELECT * FROM departments SAMPLE BLOCK (10) SEED (1); 4.Index Unique Scan:
  • 11. ; 5.Index Range Sacn: 1./, ; 2.;( , ,
  • 12. ;) 3., ; 6.Index Full Sacn vs Index Fast Full Sacn: 1.: 1.SELECT WHERE ,, NULL ; 2. 10%; 2.Index Full Sacn: 1., , ; 2. Single Read, db file sequential reads ;
  • 13. 3., Index Full Scan; 4. is not null , ; 3.Index Fast Full Sacn: 1., ,, , . SQL , ; 2. Index Fast Full Sacn , Multiblock Read, db file scattered reads,db_file_multiblock_read_cou nt ; 3., count(*) Index [Fast] Full Scan ; 4. CPU ; 4.Index [Fast] Full Scan ;
  • 14. 7.Index Skip Scan: 1., , distinct , ; 2.,, , ; 3.,, ;
  • 15. 8.Index Join Scan:, ; 9.AND-EQUAL :, rowid, rowid ; 10. Bitmap Index: 1.Bitmap ;
  • 16. 2.Bitmap ; 3.Bitmap ; 4.Bitmap AND ;
  • 17. 5.: 1.Sort Operator: 1.AGGREGATE: group ,; 2.UNIQUE:; 3.JOIN:; 4.GROUP BY,ORDER BY: group by order by ; 2.Hash Operator: 1.GROUP BY: group by ; 2.UNIQUE: SORT UNIQUE ; 3.10g ,, ORDER BY ; 6.Buffer Sort: 1.BUFFER SORT , ; 2.BUFFER ;
  • 18. 3.SORT BUFFER : PGA SQL ; 4.BUFFER SORT : 7.INLIST ITERATOR: 1. IN ,, ,; 2. UNION ALL ; 3.INLIST ITERATOR ;
  • 19. 8.: 1.Merge View: View , ; 2.No Merge View: View ,; 9. Count Count Stopkey:oracle rownum ; 1. rownum, rownum , count , count stopkey rownum (: count count stopkey count
  • 20. ). rownum , :where rownum10 , rownum TRUE); ALTER SESSION optimizer_mode = 'FIRST_ROWS_1000'; SELECT * FROM bitmap_test WHERE bit = 3; SELECT * FROM bitmap_test WHERE bit > 2; SELECT * FROM bitmap_test WHERE bit IN (2, 3); SELECT * FROM bitmap_test WHERE bit IN (2, 3) AND gender = 'M';

Search related