Archive

Archive for July, 2014

SQLite rowid picking joke….ehm algorithm

July 22nd, 2014 No comments

I laughed very hard at this:

“The usual algorithm is to give the newly created row a ROWID that is one larger than the largest ROWID in the table prior to the insert. If the table is initially empty, then a ROWID of 1 is used. If the largest ROWID is equal to the largest possible integer (9223372036854775807) then the database engine starts picking positive candidate ROWIDs at random until it finds one that is not previously used. If no unused ROWID can be found after a reasonable number of attempts, the insert operation fails with an SQLITE_FULL error.”

Source: sqlite.org

Categories: fun, nerdcore, software Tags: ,