Re: destroy table vs truncated



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

.



Relevant Pages

  • Re: (setf (getf ...))
    ... > itself, or modify of any part, car or cdr, of the list structure ... So am I missing anything? ... original value is NIL -- there's no cars or cdrs to modify. ...
    (comp.lang.lisp)
  • Re: Msconfig
    ... Autoruns is a free program that will allow you to view and/or modify ALL ... startup items. ... Donny Broome ... The say they are missing or can not be loaded. ...
    (microsoft.public.windowsxp.newusers)
  • Re: XOR drawing on Tk canvas?
    ... > Is there some trick I'm missing here, or am I going to have ... > to modify the PhotoImage directly to get my hilighting? ...
    (comp.lang.tcl)
  • Re: Script a change to 700 current users using Excel
    ... However, am I missing something? ... "Jim Vierra" wrote: ... >> This script is great, but I want to modify current users, not create ...
    (microsoft.public.windows.server.scripting)