Subject | Re: [firebird-support] Firebird database portability |
---|---|
Author | Ann W. Harrison |
Post date | 2006-11-28T19:51:03Z |
Christopher Chan wrote:
Firebird has a much more complex on disk structure that MyISAM. Having
to unpack an reconstruct every binary value in the database structure
would be a significant performance hit. For example, generators are
stored as aligned 64bit quantities on a special page type. They are
incremented in place, on the page in the cache. To make a generator
architecture independent, we would have to copy the value bytewise
off the page - because the alignment of 64 bit quantities varies -
then invert it as necessary, increment the result, then invert it
back as necessary and copy it bytewise back to the page. Firebird
finds data pages through arrays of page pointers - they would have
the same characteristics - read a page number bytewise into aligned
temporary storage, invert it - these are operations that are performed
millions of times, so small costs are significant.
Even in MyISAM, binary values are stored one way in data records and
a different way in indexes. And yes, they sometimes find that
inconvenient.
Regards,
Ann
> From mysql's documentation:Right. That's true of MyISAM though not of all MySQL storage engines.
>
> " All data values are stored with the low byte first. This makes the
> data machine and operating system independent. The only requirements for
> binary portability are that the machine uses two's-complement signed
> integers and IEEE floating-point format. These requirements are widely
> used among mainstream machines. Binary compatibility might not be
> applicable to embedded systems, which sometimes have peculiar processors."
Firebird has a much more complex on disk structure that MyISAM. Having
to unpack an reconstruct every binary value in the database structure
would be a significant performance hit. For example, generators are
stored as aligned 64bit quantities on a special page type. They are
incremented in place, on the page in the cache. To make a generator
architecture independent, we would have to copy the value bytewise
off the page - because the alignment of 64 bit quantities varies -
then invert it as necessary, increment the result, then invert it
back as necessary and copy it bytewise back to the page. Firebird
finds data pages through arrays of page pointers - they would have
the same characteristics - read a page number bytewise into aligned
temporary storage, invert it - these are operations that are performed
millions of times, so small costs are significant.
Even in MyISAM, binary values are stored one way in data records and
a different way in indexes. And yes, they sometimes find that
inconvenient.
Regards,
Ann