-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/07/12 13:20, Jay A. Kreibich wrote:
> By default, 10^9 bytes (~1GB).  Can be altered, but there is a hard 
> limit of (2^31 - 1), or 2GB.

Even more subtleties than that.  SQLite's internals are fundamentally 32
bits even on 64 bit platforms.  For example the APIs that pass data around
use 'int' which is 32 bit even on 64 bit platforms (ie the limits don't
change just by using 64 bits).

You can ask for data in UTF16 which uses a minimum of 2 bytes per
codepoint while UTF8 (the default) uses a minimum of one byte per
codepoint.  Consequently if you had a 1.1 billion codepoints in the
database itself (stored in UTF8), then you couldn't retrieve is as UTF16
because it would exceed signed 32 bit ints being used.  Lest you think
everyone is UTF8, the "normal" size for Java and Windows is UTF16.

Also the worst case for UTF8 is 6 bytes per codepoint, although they are rare.

The net consequence is that the largest size is really 1 billion
codepoints, otherwise some platforms using UTF16 will have problems.  And
if you want to be absolutely certain then the maximum is one sixth of that.

For the folks who don't know what codepoints are, or what the Unicode fuss
is then read this article titled "The Absolute Minimum Every Software
Developer Absolutely, Positively Must Know About Unicode and Character Sets"

  http://www.joelonsoftware.com/articles/Unicode.html

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk/yDNUACgkQmOOfHg372QR9twCeOP3rtAc1nbQ0gHFYL8Y97y+H
U+0AoKYpYW13yfnyKEExq2t+tgUQ+Ppb
=1cpR
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to