Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
DB Tuning Ch 14. Parallel Processing Ch 15. Performance of DML Ch 16. Analytic Function Jaeseok Myung Intelligent Database Systems Lab School of Computer Science & Engineering Seoul National University, Seoul, Korea Center for E-Business Technology Seoul National University Seoul, Korea Parallel Processing Goal Utilization of System Resource Reduction of Response Time – Multi-Processes – Response Time = CPU Time + Wait Time Architecture Query Coordinator – Syntactic Analyzing – Assign small jobs to slaves – Generate final result Slave Process – Do works – Send results Copyright 2008 by CEBT DB Tuning - 2 How to PP Parameters in Oracle Parallel_min_server – Determine initial minimum, Default : 0 Parallel_max_server – Determine initial maximum, Default : 5, Max : 255 Two ways of using PP functionality Insert a hint into a query – SELECT /*+ PARALLEL(A, 2) */ user, sum(amount) FROM sales_history GROUP BY user; Alter the degree of table – ALTER TABLE sales_history PARALLEL 2; Copyright 2008 by CEBT DB Tuning - 3 Execution Plans of PP Copyright 2008 by CEBT DB Tuning - 4 Execution Plans of PP Parallel_from_serial, Parallel_to_serial, Parallel_to_parallel Parallel_combined_with_parent, Parallel_combined_with_child Copyright 2008 by CEBT DB Tuning - 5 DB Tuning Ch 14. Parallel Processing Ch 15. Performance of DML Ch 16. Analytic Function Jaeseok Myung Intelligent Database Systems Lab School of Computer Science & Engineering Seoul National University, Seoul, Korea Center for E-Business Technology Seoul National University Seoul, Korea Issues on DML Processing Excessive Requests for Resources Rollback Segment Redo Log Disk IO Excessive Indices Overhead for index management A Misguided Execution Plan We can put ‘where clause’ into the DML Copyright 2008 by CEBT DB Tuning - 7 Insert (1) Conventional Insert INSERT INTO TAB1 VALUES (COL1, COL2); Index, Disk IO Tunings can be applied A special ‘insert’ including ‘select’ has more options INSERT INTO TAB1 SELECT COL1, COL2 FROM TAB2 WHERE COL3 > 100; Direct Loading Parallel Direct Loading Nologging Copyright 2008 by CEBT DB Tuning - 8 Direct Loading INSERT INTO TAB1 ~; INSERT INTO /*+ APPEND */ TAB1 ~; Copyright 2008 by CEBT DB Tuning - 9 Insert (2) Parallel Direct Loading Direct Loading + Parallel Functionality ALTER SESSION ENABLE PARALLEL DML; INSERT /*+ PARALLEL (A, 4) */ INTO TAB1 Nologging Only be allowed with Direct Loading or Parallel Direct Loading ALTER TABLE TAB1 NOLOGGING; We may need backup Copyright 2008 by CEBT DB Tuning - 10 Delete & Update (1) Resources Need more rollback segment than insert operation More RedoLog, More Disk IO Copyright 2008 by CEBT DB Tuning - 11 Delete & Update (2) Checkpoint Index Counts Execution Plan – Where Clause Parallel Hint DELETE /*+ PARALLEL (A, 4) */ ~; UPDATE /*+ PARALLEL (A, 4) */ ~; Alternatives Use ‘Insert’ instead of ‘Delete’ if we have too much data Less RedoLog, Less Rollback Segment Copyright 2008 by CEBT DB Tuning - 12 DB Tuning Ch 14. Parallel Processing Ch 15. Performance of DML Ch 16. Analytic Function Jaeseok Myung Intelligent Database Systems Lab School of Computer Science & Engineering Seoul National University, Seoul, Korea Center for E-Business Technology Seoul National University Seoul, Korea Analytic Function Keep SQL queries to be simple Use less GROUP BY SELECT deptno, name, sal, COUNT(sal) OVER (PARTITION BY deptno ORDER BY sal) FROM employee; AVG, COUNT, MIN, MAX, … Tune indices carefully Copyright 2008 by CEBT DB Tuning - 14 Conclusion How much helpful? – It’s not a critical section Ch 14. Parallel Processing Ch 15. Performance of DML Ch 16. Analytic Function But, Interesting Thank you Copyright 2008 by CEBT DB Tuning - 15