How SQLite index ID (or line number)
you're wrong.

There's nothing 'flat' in the SQLite database file; the file is internally split as pages, with trees and references between them.  A table doesn't' store records sequentially.

Check the file format docs