Re: destroy table vs truncated
- From: "Chip Nickolett" <ChipN@xxxxxxxxxxxxx>
- Date: 29 Aug 2006 20:11:10 -0700
JIMC wrote:
When would you use destroy table over truncated and visa versa ?
We have a table with 20,000 rows and there is an application that
performs a destroy. I would like to change that to a truncated so
other ingres accounts can empty out the table.
Jim,
If you are truly just removing data then using "modify to truncated" is
preferrable.
Dropping and recreating the table creates system catalog overhead that
could potentially lock other users due to schema locks. It could also
cause problems with objects referencing the table (rules, procedures,
views, etc.) If you didn't think to save the index information you
could create problems where a necessary secondary index is now missing.
There could be grant (permission) problems. And, if you ever need to
manually recover a table from a checkpoint (replacing the underlying
file) it will be far more difficult since the filenames change with
each new table.
What I've done as pretty standard practice is ensure that all indexes
are created "persistent", and then have a process that checks for
missing and/or different schema objects. So, if for some reason you do
the modify to truncated and forget to modify back to the original
structure (assuming that the original structure is not heap) the
process will quickly catch it and let you now what the structure should
be.
Hope that helps.
BTW, for anyone interested, we have a new white paper on B-tree tables.
Check it out at http://www.Comp-Soln.com/btree_whitepaper.pdf
Chip Nickolett (ChipN@xxxxxxxxxxxxx)
US - Comprehensive Solutions
www.Comp-Soln.com
UK - Comprehensive Solutions International, Ltd. www.Comp-Soln.co.uk
.
- Follow-Ups:
- Re: destroy table vs truncated
- From: JIMC
- Re: destroy table vs truncated
- References:
- destroy table vs truncated
- From: JIMC
- destroy table vs truncated
- Prev by Date: Re: [Info-ingres] Future of the NAIUA.ORG website ...
- Next by Date: Re: [Info-ingres] Future of the NAIUA.ORG website ...
- Previous by thread: Re: destroy table vs truncated
- Next by thread: Re: destroy table vs truncated
- Index(es):
Relevant Pages
|