Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle: why parallel delete doesn't go parallel? [duplicate]

I've tried the following statement. But it doesn't proceed parallel. Why? How can I speed up the operation?

ALTER SESSION ENABLE PARALLEL DML;

DELETE /*+ parallel(20) */
      FROM  table
      WHERE flag != 'N';

enter image description here

like image 693
Revious Avatar asked Feb 18 '26 07:02

Revious


1 Answers

try

ALTER SESSION ENABLE PARALLEL DML;
DELETE /*+ parallel(table, 20) */
  FROM  table
  WHERE flag!= 'N';

you can also try another option to delete data, using CTAS, reference from asktom Deleting many rows from a big table

create table new_table unrecoverable as select * from old_table where ....;

drop table old_table;

rename new_table to old_table;

create index old_table_idx1 on old_table(c1,c2) unrecoverable parallel 5;

like image 94
wanana Avatar answered Feb 20 '26 23:02

wanana



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!