Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Truncate table, rebuild index?
"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.htmlReceived on Mon Sep 03 2007 - 15:56:59 CDT