Safely remove table file

Dec 17, 2015 at 9:33 PM
From previous posts it seems that when you delete keys from a table, the actual data is not removed from disk. What is the correct method for deleting a table from disk and recreating it?
Coordinator
Dec 18, 2015 at 3:31 PM
Edited Dec 19, 2015 at 9:06 AM
From time to time you can copy content of one table to another (t1->t2 using SelectForward)
and then delete table t1 by (engine.Scheme.DeleteTable("t1")), then rename table t2 into t1 (engine.Scheme.RenameTable).
Dec 20, 2015 at 7:53 PM
Perfect. Do you have any built in functionality to lock table access during table deletion operations?
Coordinator
Dec 21, 2015 at 8:22 AM
Read docu from [20130613], it must be very close to what you want.
Coordinator
Dec 21, 2015 at 8:35 AM
There is also another (may be useful) command: tran.RemoveAllKeys with FileRecreation... cleans completely file.

If you have a reading thread, while deleting table, it can be a problem for the system to determine if you are going to restore that table or not.
So, system by default will return a not existing row to the reader.
That may be out of business logic. In any case you will need a special handling, if you are going to delete tables. We try not to delete data in our environment.