Larry,

>The recordsizes are fixed at 20, 22 and 26 bytes variously for the pdbs.
>
>Not accounting for chunking and overhead, the total size should be 6.7 Meg.  

And therein lies the catch; you aren't accounting for overhead.  All devices
(and not just NVFS based devices like the T5/650/E2/LD) have overhead for each
PDB record.  The exact size potentially varies by OS release, but if I'm not
mistaken all of them from 3.x to 5.x are about 20 bytes per record overhead.

Unlike the desktop format of a PDB which uses 8 bytes per record for the
recordlist overhead, the internal format is not documented by PalmSource
precisely so they can vary it by release when they need to do so.  But in any
case it needs more than the 8 bytes used in the desktop recordlist because it
needs to track not only the record attributes, category, and unique ID, but also
the memory handle, size, etc.

So a PDB with a recordsize fixed at 20 bytes will consume as much for the
recordlist overhead as it does for the data portions -- and that is without any
considerations for NVFS block size increments.  With the 22 and 26 byte records
taking slightly less than double the size including overhead, your 6.7MB of data
can easily become the 13 MB you are seeing consumed.

Note that it makes no difference here what sequence you import the databases.

>We would like to increase the efficiency.  It seems as if the import is 
>creating 1 
>chunk per record, or near to that, thus drastically reducing the efficiency.

No; the problem is the approximately 20 bytes overhead per record.  It sounds
like you have in the neighborhood of roughly 330K records between the 30 files,
which equates to about 6.3MB of overhead for the recordlists.

To increase the efficiency, redesign your pdbs to store multiple "logical"
records within each "physical" PDB record, remembering the record length limit
of somewhat under 64K per record.  Since you have fixed length records, this is
actually very easy to do mathematically.

For example, you can pack 2500 "logical" records of 20-26 bytes each into a
single PDB record.  This record then takes just 20 bytes of overhead for all
2500 logical records.  Do that for all of your PDBs and your 6.3MB of overhead
drops to about 2.6K bytes.  (How's that for a significant decrease?)

As a side benefit, you'll find your Hot Sync times will increase *dramatically*.
In fact, once you do it, you'll likely be floored at the difference and decide
using this technique is highly desirable even if space wasn't an issue.  This
alone is more than enough justification to redesign your databases, IMHO.  (The
other alternative to make sync times faster is to use compression during the
install then decompress, for example by using something like Nutshell.  But in
this case you still consume the 6.3MB of overhead once decompressed.)

As a further side benefit, you are pretty well insulated from NVFS block size
ramifications, because instead of having 330+K total records, you have only
around 130 records between all 30 databases!

Doug

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to