Subject RE: [ib-support] How to delete all rows?
Author Martijn Tonies
Hi,

I don't know how TRUNCATE (from Oracle) works internally, but I know
it isn't dropping the table and re-creating it - it is fast. Probably
just a kind of flag that marks all records or so - it's _outside_
transaction control -- so no worries about transactions.

I kinda dislike the drop etc because of the dependencies...

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com


At 10:25 AM 1/4/2002 +1100, David K. Trudgett wrote:
>On Thursday 2002-01-03 at 19:10:22 -0300, Clément Doss wrote:
>
> > Is there a way to delete ALL the records from a table REALLY fast.
> > In SQL Server there is a TRUNCATE TABLE MyTable function that is
> > very fast How can I do that in FB RC2?
>
>Under some circumstances, you could get away with dropping the table
>and re-creating it.

Something that's on my list to do is to recognize the specific command
delete from <table> with no qualification and, if possible, just drop
the table structures. That would not work if any other connection had
a prepared statement that referenced the table or if any compiled procedure
referenced the table or if any trigger on another table referenced the
table or if the table is referenced in a foreign key definition. It will
be blindingly fast.


Regards,

Ann
www.ibphoenix.com
We have answers.



[Non-text portions of this message have been removed]