It is well-known that SQLite needs to be fine tuned to achieve insert speeds on the order of 50k inserts/s. There are many q
I suspect the Index's hash value collision causes the insert speed slow.
When we have many many rows in one table, and then the indexed column hash value collision will happen more frequently. It means Sqlite engine needs to calculate the hash value two times or three times, or maybe even four times, in order to get a different hash value.
So I guess this is the root cause of the SQLite insert slowness when the table has many rows.
This point could explain why using shards could avoid this problem. Who's a real expert in SQLite domain to confirm or deny my point here?