What is the rule of thumb for compacting and reindexing a RM database?
Reindexing is needed quite often after data entry. Not to rebuild the indexes, but for its other function of updating denormalized data.
It’s not clear if the need arises because of RM errors (Data access, Index out of bounds etc) or from normal execution. In any case, RM fails to update the PersonTable with new birth and death information causing the birth and death dates in the Person index to not be in sync with the actual birth and death dates visible in the Edit Person window.
That’s not a real problem, just confusing and it may hinder your research. Just rebuild indexes and it’s fixed.
I wish that bug would be fixed.
Actually rebuilding the RM SQLite indexes should only be necessary if you move a database between platforms- Windows and MacOS. (or run SQL externally.)
After entering thousands, or millions of records, the BTree in the index may longer be optimal and data access slow down may result. Rebuild index fixes that as well. (I’ve never seen that)
Compact also rebuilds indexes- although it doesn’t do the other function of syncing the PersonTable data.
It’s main purpose is to remove empty space in the database. Unless your database is in the GByte range, who cares. I’m guessing that creating and deleting very large groups could generate lots of unused empty space.
It may detect hardware problem like bad sectors and the like since it reads every byte of the database.
Given the fact that no hardware is perfect and SQLite may have deeply hidden bugs, I’d run Check Integrity at least weekly. It will detect any database corruption, be it from software or hardware.
(It’s purely diagnostic. It won’t fix anything.)
And Compact every six months just for grins.
What do others think?
I might do more often if you have made more drastic changes (removing large # of facts or search/replacing)-- especially on large databases but you are not likely to save much space as far as % goes.
I was suggesting that the space savings were insignificant, but the full read and copy of the database would test the underlying hardware.
agreed. I probably only do at most once or twice a month when I have done lots of cleanup Or if I think there was a something off with the database. (do last step)