Presentation is loading. Please wait.

Presentation is loading. Please wait.

DB Tuning Ch 14. Parallel Processing Ch 15. Performance of DML Ch 16. Analytic Function Jaeseok Myung Intelligent Database Systems Lab School of Computer.

Similar presentations


Presentation on theme: "DB Tuning Ch 14. Parallel Processing Ch 15. Performance of DML Ch 16. Analytic Function Jaeseok Myung Intelligent Database Systems Lab School of Computer."— Presentation transcript:

1 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

2 Parallel Processing Goal Architecture 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

3 How to PP Parameters in Oracle Two ways of using PP functionality
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;

4 Execution Plans of PP

5 Execution Plans of PP Parallel_from_serial, Parallel_to_serial, Parallel_to_parallel Parallel_combined_with_parent, Parallel_combined_with_child

6 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

7 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

8 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

9 Direct Loading INSERT INTO TAB1 ~; INSERT INTO /*+ APPEND */ TAB1 ~;

10 Insert (2) Parallel Direct Loading Nologging
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

11 Delete & Update (1) Resources
Need more rollback segment than insert operation More RedoLog, More Disk IO

12 Delete & Update (2) Checkpoint Parallel Hint Alternatives 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

13 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

14 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

15 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


Download ppt "DB Tuning Ch 14. Parallel Processing Ch 15. Performance of DML Ch 16. Analytic Function Jaeseok Myung Intelligent Database Systems Lab School of Computer."

Similar presentations


Ads by Google