SQLite Forum

slow import of CSV files
Just turn off the disk synchronization on import operation and turn it on after.
* pragma synchronous = off
* import csv
* move data to target
* clear QQQ 
* pragma synchronous = off

Also you can try to process data by parts using limit and offset
insert into trg
select * from QQQ limit 100000 offset 100000 * N;

P.S. Use SSD as SQLite storage if it possible.