Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: fastest way of deleting all rows in a table

Re: fastest way of deleting all rows in a table

From: Richard Foote <richard.foote_at_bigpond.com>
Date: Sat, 1 Mar 2003 01:08:03 +1000
Message-ID: <DLJ7a.57481$jM5.145824@newsfeeds.bigpond.com>


"ShravanaKumar" <shravanakumar.ks_at_siemens.com> wrote in message news:3E5F61AF.EDCB5E19_at_siemens.com...
> Hi All,
>
> We are using Oracle 9i on Solaris 8.
>
> I would like to know, which is the fastest way of deleting all rows from
> a table and why ?
>
> a. Truncate table .....

Fastest, especially if you keep the existing storage

> b. delete table .....

Slowest

> c. drop table .... ( an re-create the table afterwards )

A close second but you will have to re-allocate the storage, re-grant any privileges, re-create indexes etc. etc. so if the intention was to simply repopulate with new data, that's what truncate was invested for.

Depends what you what to do and why ...

Cheers

Richard Received on Fri Feb 28 2003 - 09:08:03 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US