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: Bards <bards1888_at_yahoo.com.au.au>
Date: Fri, 28 Feb 2003 23:22:39 +1000
Message-ID: <1046438526.614021@fw1.mckerrs.net>


ShravanaKumar wrote:
> 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 .....
> b. delete table .....
> c. drop table .... ( an re-create the table afterwards )
>
> can some one shed light on this ?
>
> Thanks,
>
> Best Regards,
> Shravana Kumar.
>
>
>

They all do different things.

  1. keeps table structure, it basically empties the data - is non-recoverable no rollback
  2. delete from table - removes rows one bye one and updates any indexes etc, *IS* recoverable with rollback
  3. everything bye-bye - that is data and table structure etc - is non-recoverable, no rollback

see what suits your needs best.

 From my experience, drop table is the quickest,. Received on Fri Feb 28 2003 - 07:22:39 CST

Original text of this message

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