"B V, Phanisekhar" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
> So is it possible
> that SQLITE will give an error when attempting to insert a record even
> if there are free ROWID's?

Yes, in theory. If you have close to 2^63-1 rows, probing at random for 
a ROWID to reuse may just happen to keep hitting occupied ROWIDs. If I 
remember correctly, after a certain number of unsuccessful attemps 
SQLite gives up and returns an error.

Of course, it is highly unlikely that you will ever have anywhere close 
to 2^63 rows. Storage requirements alone are prohibitive. The database 
will likely become unusable long before that.

In fact, the only realistic way to take the highest possible ROWID, and 
thus force SQLite into "pick at random" mode, is to explicitly specify 
the large ROWID when inserting a record. So just don't do that.

> Please consider this scenario in the worst case. I agree that the
> number
> of ROWID's is so large, but still there is a possibility it might be
> filled.

If you insert a new record every millisecond, it will take some 300 
million years to exhaust ROWIDs. What kind of software do you develop 
that you feel this might come up as even a remote possibility?

> I basically want to understand the algorithm used by SQLITE in
> picking a new ROWID in such scenario.

Which part of "at random" do you find unclear?

Igor Tandetnik 



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to