Bit long ago to recall exactly, but to be honest I think it was quite more sinister even, if memory serves, I was modifying the
rowids too. Either way I avoid messing with rowids or relying on them altogether now as a short-cut to updating - but it s quite
safe to do so.
As an aside, while trying to remember my predicament and reading the link Donald sent, it prompted me to simply compute what a
logger would have to do to exhaust the possible rowid count as it stands now as an assessment of whether it is safe to assume there
will be enough rowids to last a good amount of time.
Basically worked out that if you wrote (assuming your hardware was capable) a thousand records every one-thousandth of a second (or
simply a million records a second), you would have 86,400,000,000 (~86 Billion) records per day and 365.224 days per year, that's
31,555,353,600,000 (~31 Trillion) records per year.
Now dividing the max_rowid by it (9223372036854775807 / 31555353600000) yields ~292,291 years. That's almost three-hundred-thousand
years.
An entire human lifespan is less than a 100th of a percent of that amount of time, or put in a less mathematical way, it is several
times longer than the entire recorded human history up to now.
I think it's safe to assume that your hardware will die before the rowids do. :)
Cheers!
On 2013/06/23 14:33, Donald Griggs wrote:
Regarding: ...then went horribly wrong at some point after rowids consumed all
of 32 bits...
If your application treated ROWIDs as 32-bit integers, that may possibly have been the cause of your problem, since ROWID's are
64-bit integers.
The maximum ROWID is 9223372036854775807 http://www.sqlite.org/autoinc.html
and would seem hard to exhaust with your application in our lifetimes.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users