SQLite Forum

Fast way to insert rows in SQLite
Login
I ran another experiment, to see if there would be any perf boost if I generate the pk instead of SQLite. 

1. When I let SQLite generate PK, it took 60s:

        59.99 real
        56.83 user
        2.33 sys

    code [here](https://github.com/avinassh/fast-sqlite3-inserts/blob/6e4b1abe59bff6c0a66ddca4a2d851bdfdb0de2b/src/bin/basic_prep.rs)


2. When I generated it in the code, it took 75s, almost 15s extra!:

        76.12 real
        71.95 user
        2.71 sys

    code [here](https://github.com/avinassh/fast-sqlite3-inserts/blob/cbe53fd3c33a7705a190ba2d3ff05d552d40a228/src/bin/basic_prep.rs)


Since SQLite makes a [function call](https://www.sqlite.org/faq.html#q1) I thought providing pk may be turn out faster. How wrong I was!