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: Truncate and insert vs drop and create

Re: Truncate and insert vs drop and create

From: Nuno Souto <nsouto_at_optushome.com.au.nospam>
Date: Thu, 17 Jan 2002 09:27:19 GMT
Message-ID: <3c46986e.2887669@news-vip.optusnet.com.au>


Philip Morrow doodled thusly:

>Which is the better way to empty a table and reload data.
>
>truncate, then use insert into x select ..... from y
>
>or is it better to
>
>drop table, then create table x as select ... from y???
>

if your table has no indexes, no synonyms, no views, no stored procedures and no authorizations using it, then drop/create is probably faster.

any exception and I'd say truncate is faster. since very few databases have tables that have no dependencies whatsoever then in most cases truncate, overall, will be faster.

Cheers
Nuno Souto
nsouto_at_optushome.com.au.nospam Received on Thu Jan 17 2002 - 03:27:19 CST

Original text of this message

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