Subject | Re: How to reduce database size after deleting records?(not by backup/restore) |
---|---|
Author | paulwesson |
Post date | 2005-02-27T13:13:59Z |
This may be more of a work-around, but what about adding a "DELETED"
field to each table, so rather than actually deleting the record, just
set its DELETED field to True. Then before doing an INSERT see if any
DELETED records exist and UPDATE them.
I know it is a crappy way to do it, but without some kind of db
utility to PACK/DEFRAG a database, it is your only option other than
the backup/restore.
I used to use this for some DBF apps I wrote... works pretty well.
field to each table, so rather than actually deleting the record, just
set its DELETED field to True. Then before doing an INSERT see if any
DELETED records exist and UPDATE them.
I know it is a crappy way to do it, but without some kind of db
utility to PACK/DEFRAG a database, it is your only option other than
the backup/restore.
I used to use this for some DBF apps I wrote... works pretty well.