| [reply] |
CREATE TABLE onegb ( alpha varchar, no varchar, hex varchar, bin varch
+ar );
.separator ","
.import file table
But if you do that alone on a csv file containing 16 million records, you'll wait days. Try it for yourself.
And doing it via SQL inserts, even with transactions, will take even longer. Again, try it for yourself.
However, if you precede the .import with the appropriate bunch of seven PRAGMA commands, then the entire import takes just over 2 minutes. But finding/working out/remembering those 7 pragmas is non-trivial.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
| [reply] [d/l] |
.echo ON
.read create_table_without_pk.sql
PRAGMA cache_size = 400000;
PRAGMA synchronous = OFF;
PRAGMA journal_mode = OFF;
PRAGMA locking_mode = EXCLUSIVE;
PRAGMA count_changes = OFF;
PRAGMA temp_store = MEMORY;
PRAGMA auto_vacuum = NONE;
.separator "\t"
.import a_tab_seprated_table.txt mytable
BEGIN;
.read add_indexes.sql
COMMIT;
.exit
sqlite3 mydb.db < commands.txt | [reply] [d/l] |
| [reply] |