On 1 Apr 2019, at 12:14pm, Gert Van Assche <ger...@gmail.com> wrote: > I need to create an SQLite db from a large TSV file. (30 GB) > Are there any setting I can give to the db so I can speed up the import?
If you're doing it using the SQLite CLI tool, then just rely on the tool to do it in the most convenient manner. If you're doing it in your own code, here is the pattern which this list thinks is fastest: PRAGMA foreign_keys = OFF; BEGIN; DROP TABLE IF EXISTS ... CREATE TABLE ... END; BEGIN; ... import all your data into the table ... END; BEGIN; ... CREATE all your INDEXes ... VACUUM; -- optional END; PRAGMA foreign_keys = ON; The VACUUM step isn't really needed. It might speed up future access or reduce the filespace used, especially for big databases. In case you wonder later, SQLite is easily able to handle a table with 30GB of data. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users