The tables aren't "cleared", they're tagged. What happens is, we set a field to 0 for all entries in the database, we then set to 1 if we have them in memory, or, if they're not in the db, we add them. At the end, it deletes all entries with the field at 0.
If you don't have UseRDB enabled, then the MySQL database will get re-populated upon the first save.