Compacting your database

From NeoWiki

Revision as of 23:02, 22 October 2009 by Sardisson (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

In the database engine embedded in Base, when records are deleted they are unlinked in the actual tables. The space used by them is not automatically freed and the indexes can be become fragmented over time. This leads to a degradation of performance.

Reclaiming Space and Repacking Indexes

There are two ways to reclaim this space and repack the indexes.

The first is to execute the SQL command
SHUTDOWN COMPACT
The disadvantage of this is that the database engine is, well shutdown. So the Base file would need to be closed and reopened.

The other is to execute this SQL command
CHECKPOINT DEFRAG
In this case the engine is also shutdown to active connections, the space used by deleted records reclaimed and the indexes rebuilt. The engine is then automatically restarted.

Either of these commands can be entered by hand in the SQL window.

Entering the SQL Commands

To enter the command by hand, begin in your main database window. In the Tools menu, choose SQL…. This brings up an Execute SQL Statement window. Type the command into the window and then click Execute.

References

Personal tools