> Quoting Dennis Cote ([EMAIL PROTECTED]):
> > Doesn't this mean that SQLite only supports 2^63 rows with
autoincrement?
>
> That means you can insert one row per millisecond for 29 million years.

Well actually, not quite. The website states that the database size is
limited to 2^41 bytes. http://www.sqlite.org/faq.html
You need 8 bytes to store the autoincrement field, and let's say you store
another 8 bytes of information. So now you've only got 2^37 records minus
database overheads, but I don't know how much that is.

So you only get about 4 years at 1 record per millisecond!

The bigger problem with regard to the initial request is that when records
are deleted, the autoincrement field just keeps going up (for 29 million
years for argument sake). So really, if you **have** to have 32 bits of
Unique ID, then maybe you need to find some other method to manage it. But,
as all the prior discussion indicates, it depends on how many updates and
for how long. Do the maths, find out how many bits you need. If you're not
going to generate more than 2^32 records over the life of the application,
then use the inbuilt AUTOINCREMENT field, and don't worry about it.

Regards,
Carl.

Reply via email to