|
|
MetaKit Tips and Tricks December 1999 |
This page list some ideas and background information
related to the use of MetaKit.
If you have suggestions, please send them to jcw@equi4.com ...
| Streaming | Some details about streaming and on-demand loading | |
| Faster | What to do and what to avoid for maximum speed | |
| Smaller | How to manage data in the most compact format |
As you can see in this overview, random-access and streaming can be mixed in three out of four ways. Once loaded, you can again save using either c4_Storage::Commit or c4_Storage::SaveToStream.
Saved using Loaded as Comments Commit
Commit
SaveToStream
SaveToStreamFile
Stream
File
StreamThe normal case, loads data on-demand
This combination is not allowed!
Ok, will load all data during open
Loads all data serially right away
When random-access and streaming are mixed on a storage object, the following will happen:
It is therefore possible to open a file, apply a few changes, save the changed contents to a stream, and then close the file without committing those changes. Streaming does not interfere with the commit/rollback mechanism.
When inserting several rows, consider inserting them all with a dummy value first, and then using a loop to adjust each of the inserted values.
MetaKit sample code - MkOptimThis a generic utility for the MetaKit library.
What it does: MkOptim is a utility program which copies data from one MetaKit file to another. This has the effect of optimizing the datafile (automatic integer sizing and compaction to remove all unused space) and of converting old datafile formats to the current one.
What it illustrates: ***TBD***
How to use it: ***TBD***.
Known problems: None.
Files in EXAMPLES\MKOPTIM:
MKOPTIM.CPP - MkOptim main program
MKOPTIM.MAK, MKOPTIM.DSP - MSVC 5.0 project makefiles for Win32