Databases Reference
In-Depth Information
of the operating system is determined by the processor that the operating system
runs on. Processors use either of the following byte-order conventions:
Big endian machines store data in memory “big-end” first. The first byte is
the biggest (most significant).
Little endian machines store data in memory “little-end” first. The first byte
is the smallest (least significant).
For example, let's consider the integer 56789652, which is 0x03628a94 in
hexadecimal. On a big endian machine, the 4 bytes in memory at address
0x18000 start with the leftmost hexadecimal digit. In contrast, on a little endian
machine, the 4 bytes start with the rightmost hexadecimal digit.
Big Endian
18000 18001 18002 18003
0x03 0x62 0x8a 0x94
Little Endian
18000 18001 18002 18003
0x94 0x8a 0x62 0x03
Intel's 80x86 processors and their clones are little endian. Sun Microsystem's
SPARC, Motorola's 68K, and the PowerPC families are big endian. Java Virtual
Machines (JVMs) are big endian as well. Some processors even have a bit in the
register that allows you to select which endianness you want the processor to use.
Performance Tip
If possible, match the endianness of the operating system on the data-
base client to that of the database server. If they match, the database dri-
ver doesn't need to perform extra work to convert the byte order of
multibyte data.
For example, suppose you have an accounting application that allows you to
prepare financial statements such as balance sheets, income statements, cash
flows, and general ledger accounts. The application runs on Windows XP and
retrieves data from a Microsoft SQL Server database running on Windows NT.
The database driver doesn't need to convert the byte order of long integers
Search WWH ::




Custom Search