Kbase P36834: What is the fastest way to remove all records from a database table?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/15/2008 |
|
Status: Verified
GOAL:
What is the fastest way to remove all records from a database table?
FIX:
The fastest way to remove all records from a database table without messing around with the metasachema is to use the following code:
FOR EACH YourTableNameGoesHere EXCLUSIVE-LOCK:
DELETE YourTableNameGoesHere.
END.
You can increase the performance of the above code by tuning the database for this specific task. Do not allow other users to access the database during this exercise.
1) Backup the database, due to using the -i parameter in the next step.
2) Start the database in multi-user mode with some additional parameters:
proserve YourDatabaseNameGoesHere -B 5000 -bibufs 40 -spin 2000 -i
Note that you should use -spin 1 if you only have a single CPU machine and
the bigger -B the better up to the amount of available physical memory.
3) Start an APW.
proapw YourDatabaseNameGoesHere
4) Start a BIW.
probiw YourDatabaseNameGoesHere
5) Start your client session and run the above code.
mpro YourDatabaseNameGoesHere