Sie sind auf Seite 1von 2

Data Partitioning with Partition Tables: Used to manage huge loads of data in table by creating Logical Partition s.

Improves the performance of Oracle while retrieving or manipulating data from Huge Tables. Ex: create table emp_part (ecode number(2) primary key, ename varchar2(20), sal number(10,2)) partition by range (ecode) (partition p1 values less than (11), partition p2 values less than (21), partition p3 values less than (31), partition p4 values less than (41), partition p5 values less than (maxvalue)); Before ALTER : p1 -- 1 - 10 p2 -- 11 - 20 p3 -- 21 - 30 p4 -- 31 - 40 p5 -- 41 - N insert into emp_part values (1,'RAM',12000); insert into emp_part values (3,'RAM',13000); insert into emp_part values (7,'RAM',17000); insert into emp_part values (11,'RAM',2000); insert into emp_part values (13,'RAM',3000); insert into emp_part values (17,'RAM',7000); insert into emp_part values (21,'RAM',22000); insert into emp_part values (23,'RAM',23000); insert into emp_part values (27,'RAM',27000); insert into emp_part values (31,'RAM',10000); insert into emp_part values (33,'RAM',14000); insert into emp_part values (37,'RAM',15000); insert insert insert insert into into into into emp_part emp_part emp_part emp_part values values values values (41,'RAM',31000); (43,'RAM',33000); (47,'RAM',37000); (67,'RAM',57000);

select * from emp_part; select * from emp_part partition (p2); select * from emp_part partition (p3) where sal > 20000; alter table emp_part drop partition p5; -------------------------------------------------------------Bulk Bind: [ 8.0 ] Used to improve performance of oracle while manipulating data thru pl/sql bl ock. It will perform entire loop transactions in 1 iteration. CREATE TABLE test1(id NUMBER(10) primary key, description VARCHAR2(50)); * Time Taken with Numeric For loop - 1.02 min begin

for i in 1 .. 10000 loop insert into test1 values(i,'description: '||i); end loop; end; 1 description: 1 2 description: 2 3 description: 3 . . 10000 description: 10000 * Using the FORALL construct to bulk bind the duced to 18 seconds: DECLARE TYPE id_type IS TABLE OF test1.id%TYPE; TYPE description_type IS TABLE OF YPE; t_id id_type := id_type(); t_description description_type := BEGIN -- filling pl/sql tables with data FOR i IN 1 .. 10000 LOOP t_id.extend; t_description.extend; t_id(t_id.last) := i; t_description(t_description.last) := 'Description: ' ||to_char(i); END LOOP; FORALL i IN t_id.first .. t_id.last INSERT INTO test1 (id, description) VALUES (t_id(i), t_description(i)); COMMIT; END; inserts this time is re

test1.description%T description_type();

Das könnte Ihnen auch gefallen