Re: Deleting all rows from a Table

From: John V. Greco <jvgreco_at_primenet.com>
Date: Thu, 16 Mar 1995 18:47:36 CST
Message-ID: <jvgreco.7.15F3C42E_at_primenet.com>


In article <3kag1m$bap_at_noc.tor.hookup.net> Greg Watt <tipps_at_ottawa.cbc.ca> writes:
>From: Greg Watt <tipps_at_ottawa.cbc.ca>
>Subject: Deleting all rows from a Table
>Date: 16 Mar 1995 23:02:14 GMT
 

>We have a table with no fewer than 24 integrity constraints. The table currently
>contains 9500 rows. How long should a DELETE table_name WHERE col_name = 'xxxxx'
...

If you want to delete ALL the rows, use TRUNCATE table table_namethis  retains the structure and constraint definitions but empties the data. WARNING - this can not be rolled back!

Otherwise, the delete should run fairly fast if the process dosen't have to update the referentials - so I don't know why yours is slow. I can delete 4000 rows from a 120000 row table with a "delete from big_table where column_colvalue = 'XXX' " with no constraints in less than 5 MInutes and thats on a Netware server with 40MB and a 50Mh 486DX, so I suspect the constraints are the bottleneck.

John Greco Received on Fri Mar 17 1995 - 01:47:36 CET

Original text of this message