I have a table which needed to be truncated and re-import data
everyday. Do I needed to rebuild the associated indexes to
get a better perfermance after each "truncate"?
(Will there any performance problem
in the indexes tablespace)
Thanks for any help
W.
Wayne, When you truncate the table the indexes are also truncated.
When you reload Oracle updates the indexes. As a general rule you are
good to go though you might want to consider updating the statistics
immediately after the reload.
-- Mark D Powell --
"Mark D Powell" <mark....@eds.com> wrote in message
news:178d2795.01122...@posting.google.com...
--
Posted from d225s229.hotbank.com [63.83.225.229]
via Mailgate.ORG Server - http://www.Mailgate.ORG
> Cantonese Boy <wayn...@yahoo.com> wrote in message news:<3C22DFB6...@yahoo.com>...
> Wayne, When you truncate the table the indexes are also truncated.
> When you reload Oracle updates the indexes. As a general rule you are
> good to go though you might want to consider updating the statistics
> immediately after the reload.
I suggest drop indexes before loading, recreate
after loading and analyze table compute statistics.
It will be nice but maybe more complicated B-)
-- Best regards, Igor Ushkalo (igorus!) - igorus(at)mail.ru,
ICQ #19972198
"Cantonese Boy" <wayn...@yahoo.com> wrote in message
news:3C22DFB6...@yahoo.com...
If you reload the table everyday, I suggest that you truncate
with "reuse storage". This can make a big difference depending
on the size of the table.
1. This will make your truncate immediate. Otherwise oracle would
have to de-allocate all the extents (default) and that can take
long time.
2. This will avoid enqueue contention to other sessions.
Oracle holds ST enqueue when allocating or de-allocating extents.
There is only 1 ST enqueue in the entire database.
This way, you also avoid enqueue contention when you load the data.
-Bass Chorng
krishnananda, when you truncate the table the high-water mark is also
reset for the indexes and all extents except the initial extent are
returned to free space (unless reuse storage is specified). Oracle
does not clean the old, but no longer used blocks, until the blocks
are re-allocated to the same or a new object.