Linn,

>But is
>there a limit to the total size of the tables?  I'm
>using Satellite Forms and importing data from a Visual
>FoxPro application.

The limitations vary somewhat by OS version.  Prior to OS 3.5, the headers did
not specify UInt16 but just used signed integers everywhere.  Thus before 3.5,
the maximum record count was 32767 instead of 65535.  In theory, the headers
changed in 3.5 but a few Dm...() apis mistakenly still used Int16 instead of
UInt16.  Among those was DmFindSortPosition(), which means you had to avoid that
API or use an alternative until that was corrected in OS 4.1 (as I recall).

So in general I think of the limit as 32K records until OS 4.1 even though you
could physically store and retrieve up to 64K records starting in version 3.5.

The maximum length of a record also has changed in the past, but think it has
been 65505 bytes since OS 3.0 or so.  I typically consider 65000 my cutoff point
when building records.

However, those are just maximum theoritical sizes.  In practice, you may not
want a PDB with anywhere close to 32000 records, let alone 64000 records.  The
problem here is strictly one of installation of the database.  Hot Sync has a
major performance problem as the *record count* increases, irrespective of the
total byte count of the database.

This bottleneck is somewhat less severe under OS5, but if you run some tests you
will be shocked at the speed difference of installing say 100 records of 30000
bytes each compared to 30000 records of 100 bytes each.  Note that once on the
device, databases with "large" record counts perform just fine -- it is only the
process of getting them there via Hot Sync which is the issue.

In general, those of us who need "large" databases have taken the approach that
having fewer, longer physical PDB records where we pack multiple "logical"
records within each physical record is the way to go.  Depending on what I'm
storing, I may have hundreds or even thousands of "records" packed inside each
physical PDB record as far as Palm OS is concerned.  This complicates access
somewhat but the difference in install performance is astounding.

And it lets me exceed the 64K limit on record counts, which in some cases has
been important for my scenarios.

An alternative approach is to use a self-extracting compressed installer, such
as Nutshell, which packs your original PDB records into long records for you
then decompresses the data and creates the database on the device with the
original record count.  But you'd still be limited to 64K records maximum (or
32K prior to OS 4.1, if you need to support it).  And you'd need more available
space on the device during the install process, since the compressed version
must be installed first then decompressed.

Still another alternative is to keep "large" databases on external memory cards
and use VFS for access instead. Then update the databases by using card readers
or whatever instead of Hot Sync.

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