Compact your Database for Best Performance

Databases have a way of “swelling” over time, and to remain at their peak performance, it’s necessary to periodically “compact” them.

The reason for this strange phenomena lies in the way virtually all but the smallest databases are designed. When you load up most types of documents on your computer (like, say, a Word file), the entire document is loaded into memory, then written back to disk when you click Save. Databases, on the other hand, are designed to live primarily on your computer’s hard disk, and are saved after each change you make. This has the advantage of preventing you from losing all your work after a crash or power failure, and it lets you work with databases which are so large that you’d never get them loaded up into your system’s RAM.

The downside, however, comes in that when you change or delete information in a database, it can’t just write out the whole database to your hard disk with the changed information (that would take several minutes each time you changed a record). Instead, the database program internally marks the old information as obsolete, and adds on the new information to the end of the file, updating its internal structure so that you’ll never see the old information when you use the database. This is all to the good, and allows for speedy updates of databases (even very large ones), but it has the unfortunate side effect of making databases swell over time with the bulk of obsolete data.

The remedy for this is to periodically Compact your database (in ComicBase, use File > File Tools > Compact & Verify).

File Tools

This forces the database engine to sort through all the records in the file, throw out the old, and rewrite the database using only current information. It also rebuilds various indexes and checks over various internal data structures. It takes a few minutes to do this (and your hard drive will spin like mad while it does), but periodic compacting will both increase your database’s performance, as well as save potentially many megabytes of wasted space on your hard disk. For reference sake: the ComicBase 11 database should be somewhat under 300 MB in size: if yours is larger, compacting is a good idea.

You can also set ComicBase up to periodically compact and verify your database when you exit the program, using a setting under Setup > ComicBase Preferences. We generally recommend setting your ComicBase to automatically compact and verify when the free space in the database builds up to about 10% of the total size.

Compact Settings