Hacker News new | ask | show | jobs
by LtWorf 16 days ago
What should it do once you hit MAXINT? Honest question…
2 comments

I don’t think people are criticizing the MAXINT thing. The problem is that IDs are already reused when you create 10 rows, delete 5 and then make a new one. Normal DB engines just keep counting afaik so the new ID will still be one that has never been used before.
In SQLite the max int is 64 bit. So a rather large number (about 9 billion billion, aka 19 digits). That's a lot of rows to add.

I would suggest if you are storing that much data, SQLite may not be the correct engine. (And you probably shouldn't be using an Int primary key.)

It's a good question to ask, but probably not a concern for most of us.