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 table, rebuild index?

Re: Truncate table, rebuild index?

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Mon, 3 Sep 2007 21:56:59 +0100
Message-ID: <v7udnaj2j8mW6EHbnZ2dnUVZ8qKvnZ2d@bt.com>

"Andrea" <netsecurity_at_tiscali.it> wrote in message news:1188816830.056581.215740_at_k79g2000hse.googlegroups.com...
> hi,
> for some management works i've truncate a table with reuse storage
> option and next i run "insert" for repopulating table with the same
> original data. In this case, is useful to rebuild indexes of the table
> or not?
>
> thanks for your response
>
> bye
>

Where does the data come from that you insert to "repopulate" the table. Is the whole exercised aimed at copying out a small fraction of the table to get rid of most of the data, then copying it back in ? If so, then "insert /*+ append */" would be your best option as this will insert the data without generating UNDO for the table, and will do a delayed index build (rather than row by row maintenance) that will be at least as effective as a separate "create index" in terms of resource usage and index packing.

-- 
Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com

Author: Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html
Received on Mon Sep 03 2007 - 15:56:59 CDT

Original text of this message

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