On Thu, Mar 31, 2005 at 12:07:22PM -0800, Jay wrote:
> I thought sqlite stored the columns as text internally and converted when
> appropriate. It should therefore be able to handle 64 bit numbers without
> problem.

Not according to the "Datatypes" document for version 3:

     http://www.sqlite.org/datatype3.html

The top of this document indicates that while version 2 did store all columns
as text, version 3 has the ability to store integer and real numbers in a more
compact format. Specifically for integers, the values are stored as signed
integers using 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the
value.

> Have you tried eliminating the offset calculation and just using the raw
> values?

I suppose I could convert the unsigned address into a string. But UINT64_MAX
(2^64 - 1) is:

     18,446,744,073,709,551,615

which, without the commas, would require 20 bytes to store. Quite a bit more
than the 8 bytes it should require... Did I mention that I'll be storing tens
to hundreds of thousands of these addresses? ;-)

Also, I don't know if the arithmetic operators in SQLite would work properly on
these text columns. I suspect it would try to convert them from text to integer
and then have the same sort of problem...

-- William Hachfeld

Reply via email to