date sort vs id sort

Posted on
Fri Mar 21, 2014 10:31 am
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

date sort vs id sort

I am currently using a query simple sorting by ID. That seems to be 100% correlated to the date-time stamp - have not seen any exception.
Is this assumption correct, and what happens if the ID gets larger than 2**64 (probably after my EOL).
thx

Karl
Last edited by kw123 on Fri Mar 21, 2014 10:59 am, edited 1 time in total.

Posted on
Fri Mar 21, 2014 10:56 am
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

Re: date sort vs id sort

From the SQLite docs:

sqlite.org wrote:
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.


But based on my math and assuming that 10,000 rows are added every second (higher than Indigo Server could handle), then it wouldn't hit the maximum for 29.2 million years. So even if it didn't try to find unused positive candidates I wouldn't worry about it. ;-)

Image

Posted on
Fri Mar 21, 2014 11:01 am
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: date sort vs id sort

so you mean your company is short lived, using tools that only last 27 M years?

Posted on
Fri Mar 21, 2014 11:50 am
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

Re: date sort vs id sort

Just part of our planned obsolescence strategy to make customers upgrade every 20 or 30 million years.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests