Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Delete performance
Dont use a PL/SQL cursor and loop, when bulk deletes are a possibility.
Delete from table where rownum < 1000;
commit;
Delete from table where rownum < 1000;
commit;
.....................................................
I would prefer this approach. 200000 is not much. With a create table as you suggest, a lot of things to take care of. Viz. grants, rename, rebuild indexes, space, backup after the creation, drop the old table, drop indexes, et all.
Raj
Gurelei <gurelei_at_yaho To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> o.com> cc: Sent by: Subject: Delete performance root_at_fatcity. com August 01, 2002 10:03 AM Please respond to ORACLE-L
Hi all:
Someone at my shop wants to delete about 20% of roes
in a table (200000 rows out of a million). He wants to
set a commit frequency (like every 1000 records or
so)
to keep the rbs under control. I am not aware of any
easy way to do it other then writing a procedure, but
I may be missing something here. Is there any simple
way to accomplish this?
Also I have suggested instead of deleting 20% of the rows, create a new table as a select and insert the rest of the rows into it (then rebuild the indices and rename). This can be done in nologging mode, without redo logs and rbs segments. Is this a good idea to try?
thanks for any info
Gene
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
INET: Rajesh.Rao_at_jpmchase.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Aug 01 2002 - 12:18:30 CDT