---- Start
Everyone is familiar with how to delete data. We use this to write:
Delete from <table_name> where <condition>;
In fact, this write performance is not good, especially when you delete a large amount of data, to achieve better performance, you can use the following method:
Delete from <br/> (<br/> select * from <table_name> where <condition> <br/> );
What should I do if I want to delete all the data in a table? Some people may say that this is simple. simply remove the WHERE clause. Correct answer,This is a method. When the data volume is large, it takes a long time to delete the data. Someone may drop the table first and then create the table,This is the second method.This process is fast but troublesome. ActuallyMethod 3,It is faster and simpler, as shown below:
Alter table <table_name> activate not logged initially with empty table
It is solemnly stated that after the preceding statements are used, the operations on the table will not be recorded, and there may be problems during recovery, so it is particularly suitable for temporary tables. The preceding statements must be used with caution. I am not responsible for any consequences.. Of course, there are other methods, but thatIt's not SQL. It's a DB2 command.We will not introduce it here.
--- For more information, see:DB2 SQL
----Statement: indicate the source for reprinting.
---- Last updated on 2009.12.4
---- Written by shangbo on 2009.9.25
---- End